Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Python 3.11b1 raises with the following givenpath.rglob("") wherepath is apathlib.Path. This worked in previous versions (and also in whichever previous alphas GitHub Actions used).
defrglob(self,pattern):"""Recursively yield all existing files (of any kind, including directories) matching the given relative pattern, anywhere in this subtree. """sys.audit("pathlib.Path.rglob",self,pattern)drv,root,pattern_parts=self._flavour.parse_parts((pattern,))ifdrvorroot:raiseNotImplementedError("Non-relative patterns are unsupported")>ifpattern[-1]in (self._flavour.sep,self._flavour.altsep):EIndexError:stringindexoutofrange
rglob isdocumented as
This is like callingPath.glob() with “**/” added in front of the given relative pattern
so I think"" is a valid input torglob().
Pretty sure this was introduced inea2f5bc/#10349.
Your environment
- CPython versions tested on: 3.11b1
- Operating system and architecture: Both Linux and Windows.
Cross-ref:pytest-dev/pytest#9930