-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
Inconsistent pathlib recursive globbing when using Windows 10 case-sensitive filepaths #94537
Comments
|
@barneygale, what do you think about an inheritable override for case sensitivity, e.g. |
Does |
For pattern matching, one needs to know whether or not the directory is case insensitive, e.g. should "a.txt" match "A.TXT"? In Windows 10 ( For now, I'm suggesting to only implement a manual parameter that overrides the platform default case sensitivity, which will be inherited for child paths returned as |
👍 gotcha. At the moment it's finnickity to pass a |
FYI, @calebthomas259 would that satisfy your use case (once Python 3.12 is released)? |
Yes! Thank you! |
Bug report
Windows now supports marking specific directories on an NTFS filesystem as case sensitive (link). Unfortunately, there seems to be inconsistent behaviour when detecting case-sensitive filenames using pathlib's recursive globbing.
Minimal example
Run these commands in PowerShell:
Run these commands in interactive Python:
To clean up, return to PowerShell then type:
Actual behaviour
Method 1 detects both files, whereas method 2 only detects one file.
Expected behaviour
Both methods should detect the same number of files.
Your environment
CPython version tested on: 3.9.5 (installed via miniconda). Full version string is
Python 3.9.5 (default, May 18 2021, 14:42:02) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Operating system and architecture: Windows 10, Version 21H1 (OS Build 19043.1766), x86_64 architecture
Filesystem: NTFS (set up on solid state drive). Some relevant details (taken from
fsutil fsinfo volumeInfo
) are:Some more relevant details (taken from
fsutil fsinfo ntfsInfo
) are:The text was updated successfully, but these errors were encountered: