Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] infinite loop on windows: searching for files #379

Open
bkreider opened this issue Mar 14, 2022 · 1 comment
Open

[BUG] infinite loop on windows: searching for files #379

bkreider opened this issue Mar 14, 2022 · 1 comment
Labels
TRIAGE Uncategorized issue

Comments

@bkreider
Copy link

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
@bkreider bkreider added the TRIAGE Uncategorized issue label Mar 14, 2022
@AlbertDeFusco
Copy link
Collaborator

I believe this PR will fix the issue: #380

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TRIAGE Uncategorized issue
Projects
None yet
Development

No branches or pull requests

2 participants