Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.6 compatibility; Path.glob() #11

Closed
allburov opened this issue Feb 13, 2018 · 4 comments
Closed

Python 3.6 compatibility; Path.glob() #11

allburov opened this issue Feb 13, 2018 · 4 comments

Comments

@allburov
Copy link
Member

Parallels/artifactory#49

Hi,

It appears that globbing behavior in Pathlib has changed/optimized to use scandir in 3.6: https://bugs.python.org/issue26032

  File "/usr/lib/python3.6/pathlib.py", line 1081, in glob
    for p in selector.select_from(self):
  File "/usr/lib/python3.6/pathlib.py", line 489, in select_from
    scandir = parent_path._accessor.scandir
AttributeError: '_ArtifactoryAccessor' object has no attribute 'scandir'

Trivially implementing scandir on _ArtifactoryAccessor results in a second failure, so this may be more than just adding a new method that wraps listdir.

@Xcelled
Copy link

Xcelled commented Jun 16, 2018

I have a workaround I posted on the other repo.

@allburov
Copy link
Member Author

allburov commented Jun 16, 2018

Hello, can you give link to commit with this fix or create pull request?)

@Xcelled
Copy link

Xcelled commented Jun 16, 2018

Parallels/artifactory#49

It's hacky so I don't want to make a pull request as is. As I mention, I'm not even sure if this is the best way to implement scandir.

@kryzdof
Copy link

kryzdof commented Aug 2, 2018

I tried your workaround and it worked fine for me.
I would recommend to put it in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants