-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
pathlib Path.match does not behave as described #79669
Comments
The documentation for pathlib PurePath.match(needle) says it accepts "glob-style pattern.". For an absolute path with a recursive pattern (**) it doesn't match correct for more than 1 directory level. All of the assertions in the attached file should pass. The issue I've seen is on the attached file. I'm using Python 3.7.1 and have also tested this against Python 3.6.6 with the pathlib module on PyPi. Absolute path glob'ing with a recursive pattern works as expected: entries = pathlib.Path('/var').glob('/var/**/*.log') Once this issue is confirmed, I would be happy to test & contribute a fix |
Is this similar to bpo-29249 (See also msg285311) and bpo-34731 ? As I can see in Lib/test/test_pathlib.py there are also no tests for "**" and I think it's good to add one along with documenting it. |
Raised a PR for the test. Will look into doc PR |
Yes, this is similar to https://bugs.python.org/issue29249 |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: