-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
glob() recursively matches on * #98
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
Unfortunately the test suite for I added a (failing) test for this in PR #99. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Thanks for the report. This functionality was added in #85 (zipp 3.11) and Python 3.12 (not a regression). The early implementation attempted to re-use the selection functionality from pathlib, which was messy because it required constructing a Path object with all of the platform-specific behaviors that brought. I re-wrote the implementation to have a native implementation, but clearly missed some important cases. It sure would be nice to have fixes for these. I'm not entirely confident a proper solution can be developed in short order, though I plan to work on it. |
This a bug made it into the Python 3.12 stdlib.
Issue
When you have a
.zip
containinga/b/c.txt
, and on the top-level do.glob('*.txt')
, it produces a match when it shouldn't..glob()
is accidentally implemented to always behave like the recursiverglob()
if a*
is used.Repro
Using the released Python 3.12
zipfile
stdlib; the same happens with currentzipp
:Prints
when it shouldn't.
Reason
This code
zipp/zipp/__init__.py
Lines 370 to 375 in ee6d711
uses
fnmatch.translate()
when thefnmatch
docs sayThe text was updated successfully, but these errors were encountered: