-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
glob('**')
returns all files and directories
#102
Comments
That's interesting, because |
glob('**')
returns all files and directoreisglob('**')
returns all files and directories
You are right, and it gets even more confusing:
I think there should be a Python upstream issue to document all of that, including the differences between Then ReproPython 3.10.11 mkdir -p dir/subdir ; touch toplevel.txt dir/indir.txt creates:
>>> import glob, pathlib
>>> glob.glob('**')
['dir', 'toplevel.txt']
>>> glob.glob('**', recursive=True)
['dir', 'dir/subdir', 'dir/indir.txt', 'toplevel.txt']
>>> list(pathlib.Path('.').glob('**'))
[PosixPath('.'), PosixPath('dir'), PosixPath('dir/subdir')] |
@nh2, since a lot of work has been done upstream to clarify the behavior, intent, and exceptions, would you be willing to review the state of the art for CPython (pathlib) and make a recommendation for what behaviors would be best for zipp.Path/zipfile.Path? |
I would like to, but I expect that this month I'll be completely out of time. |
Sounds good. I'll assign it to you but also flag it up for others to consider. Take your time and come back to it when you're up for it. If someone else wants to help, please comment here first. |
A further bug is that
glob('**')
inzipp
returns all files and directoreis, whilepathlib.Path.glob('**')
returns only directories.Originally posted by @nh2 in #98 (comment)
The text was updated successfully, but these errors were encountered: