GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||
GeezerVison is showing github.com — bpo-22276: Fix pathlib.Path.glob not to ignore trailing path separator by e-kwsm · Pull Request #10349 · python/cpython Conversation
|
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
fdc8e41 to
187aaf0
Compare
|
I didn't expect the Spanish Inquisition. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Nobody expects the Spanish Inquisition! @serhiy-storchaka: please review the changes made to this pull request. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to use sep and altsep (and corresponding pathlib attributes) instead of hardcoding '/' in the general code.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
187aaf0 to
dcae663
Compare
|
@serhiy-storchaka Thank you for your advice. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
BTW, I address bpo-33392 ( |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
ping |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
/cc @barneygale |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hey @e-kwsm, sorry for the long wait. Are you still interested in working on this PR? If so I can help review. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Yes. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@e-kwsm The bot is broken and is being fixed so no worries. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I don't think the code should make additional |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
You can also press "Update branch" to trigger testing. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I propose simpler patch: diff --git a/Lib/pathlib.py b/Lib/pathlib.py index 4763ab54f6..a759db1684 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -281,7 +281,9 @@ def make_uri(self, path): def _make_selector(pattern_parts, flavour): pat = pattern_parts[0] child_parts = pattern_parts[1:] - if pat == '**': + if not pat: + return _TerminatingSelector() + elif pat == '**': cls = _RecursiveWildcardSelector elif '**' in pat: raise ValueError("Invalid pattern: '**' can only be an entire path component") @@ -943,6 +945,8 @@ def glob(self, pattern): drv, root, pattern_parts = self._flavour.parse_parts((pattern,)) if drv or root: raise NotImplementedError("Non-relative patterns are unsupported") + if pattern[-1] in (self._flavour.sep, self._flavour.altsep): + pattern_parts.append('') selector = _make_selector(tuple(pattern_parts), self._flavour) for p in selector.select_from(self): yield p @@ -956,6 +960,8 @@ def rglob(self, pattern): drv, root, pattern_parts = self._flavour.parse_parts((pattern,)) if drv or root: raise NotImplementedError("Non-relative patterns are unsupported") + if pattern[-1] in (self._flavour.sep, self._flavour.altsep): + pattern_parts.append('') selector = _make_selector(("**",) + tuple(pattern_parts), self._flavour) for p in selector.select_from(self): yield p |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
You're right, but I was also trying to get rid of the old CLA check. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
7c7f251 to
937b12a
Compare
|
@serhiy-storchaka Thank you for your review. I have reflected your suggestion. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Serhiy Storchaka <[email protected]>
|
@e-kwsm would you mind signing our new digital CLA (see the "details" link in the failing status check)? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Done. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.