Skip to content

glob method broken in python 3.11 #396

@sm-gravid-day

Description

@sm-gravid-day

The glob method is broken in python 3.11. I've tested the same code in 3.10.8 and all is fine, but looks like things have changed in 3.11...

from artifactory import ArtifactoryPath
rt_path = ArtifactoryPath(MY_ARTIFACTORY_PATH, apikey=MY_APIKEY)
print(len([p for p in rt_path]))  # all fine, but glob blows up...
next(rt_path.glob('**/manifest.json'))

Traceback (most recent call last):
  File "/src/./bug.py", line 9, in <module>
    next(rt_path.glob('**/manifest.json'))
  File "/usr/local/lib/python3.11/pathlib.py", line 953, in glob
    for p in selector.select_from(self):
  File "/usr/local/lib/python3.11/pathlib.py", line 407, in _select_from
    for starting_point in self._iterate_directories(parent_path, is_dir, scandir):
  File "/usr/local/lib/python3.11/pathlib.py", line 386, in _iterate_directories
    with scandir(parent_path) as scandir_it:
         ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/pathlib.py", line 938, in _scandir
    return os.scandir(self)
           ^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'my path set above ^^'

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugHelp WantedWe will be glad if somebody proposes a solution via PR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions