8000 [BUG] infinite loop on windows: searching for files · Issue #379 · anaconda/anaconda-project · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[BUG] infinite loop on windows: searching for files #379
Open
@bkreider

Description

@bkreider

ALL software version info

version 0.10.1

Description of expected behavior and the observed behavior

On windows there are two functions that recursively look in parent directories. Because the windows filesystem is case insensitive, it can get trapped at c:\ forever looping. These two functions suffer from the problem:

  • local_state_file.py:42:def load_for_directory
  • project_lock_file.py:45:def load_for_directory

When it gets to C:\ it does a string compare that looks like this: "c:\ == C:". Since this is never true, it gets trapped in an infinite loop.

       current_dir = directory
        while current_dir != os.path.realpath(os.path.dirname(current_dir)):
            for name in possible_project_lock_file_names:
                path = os.path.join(current_dir, name)
                if os.path.isfile(path):
                    return ProjectLockFile(path)

            if scan_parents:
                current_dir = os.path.dirname(os.path.abspath(current_dir))
                continue
            else:
                break

Metadata

Metadata

Assignees

No one assigned

    Labels

    TRIAGEUncategorized issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0