Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

pathlib.Path.rglob("") raises IndexError in Python 3.11b1 #92550

Closed
Assignees
serhiy-storchaka
Labels
3.11only security fixes3.12only security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@bluetech

Description

@bluetech

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

Metadata

Metadata

Labels

3.11only security fixes3.12only security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp