Issue35488
Created on 2018-12-14 06:40 by anthony shaw, last changed 2019-04-08 07:52 by anthony shaw. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| test_pathlib.py | anthony shaw, 2018-12-14 06:40 | |||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 11171 | merged | anthonypjshaw, 2018-12-14 22:48 | |
| Messages (5) | |||
|---|---|---|---|
| msg331782 - (view) | Author: anthony shaw (anthony shaw) | Date: 2018-12-14 06:40 | |
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
|
|||
| msg331791 - (view) | Author: Karthikeyan Singaravelan (xtreak) * | Date: 2018-12-14 09:49 | |
Is this similar to issue29249 (See also msg285311) and issue34731 ? 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. |
|||
| msg331878 - (view) | Author: anthony shaw (anthony shaw) | Date: 2018-12-14 22:49 | |
Raised a PR for the test. Will look into doc PR |
|||
| msg331890 - (view) | Author: anthony shaw (anthony shaw) | Date: 2018-12-15 09:02 | |
Yes, this is similar to https://bugs.python.org/issue29249 In that issue, it suggests this feature is not supported, but that is neither documented, nor tested. |
|||
| msg333117 - (view) | Author: Brett Cannon (brett.cannon) * | Date: 2019-01-06 20:31 | |
New changeset 83da926b89daf80013ea966037c2c0e1e9d25c6b by Brett Cannon (Anthony Shaw) in branch 'master': bpo-35488: Add tests for ** glob matching in pathlib (GH-11171) https://github.com/python/cpython/commit/83da926b89daf80013ea966037c2c0e1e9d25c6b |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2019-04-08 07:52:28 | anthony shaw | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2019-01-06 20:31:31 | brett.cannon | set | messages: + msg333117 |
| 2018-12-17 21:49:59 | brett.cannon | set | nosy:
+ brett.cannon |
| 2018-12-15 09:02:45 | anthony shaw | set | nosy:
- serhiy.storchaka messages: + msg331890 |
| 2018-12-15 02:48:49 | xtreak | set | nosy:
+ serhiy.storchaka |
| 2018-12-14 22:49:13 | anthony shaw | set | messages: + msg331878 |
| 2018-12-14 22:48:35 | anthonypjshaw | set | keywords:
+ patch stage: patch review pull_requests: + pull_request10410 |
| 2018-12-14 09:49:03 | xtreak | set | messages: + msg331791 |
| 2018-12-14 08:53:01 | xtreak | set | nosy:
+ xtreak |
| 2018-12-14 06:40:23 | anthony shaw | create | |