liormizr / s3path

s3path is a pathlib extension for AWS S3 Service
Apache License 2.0
206 stars 39 forks source link

glob is broken #101

Closed avibrazil closed 1 year ago

avibrazil commented 2 years ago

Following code doesn't work:

import s3path

s3=s3path.S3Path.from_uri('s3://bucket-name/folder1/folder2')

list(s3.glob('*pkl'))

Last part of error:

~/.local/lib/python3.10/site-packages/s3path.py in is_dir(self)
    664         if self.bucket and not self.key:
    665             return True
--> 666         return self._accessor.is_dir(self)
    667 
    668     def is_file(self):

AttributeError: '_NormalAccessor' object has no attribute 'is_dir'

Tested in s3path 0.3.2. I can't use 0.3.3 because it has other glob-thread-related bugs.

liormizr commented 2 years ago

Hi @avibrazil Sorry for the delay

Something is strange in your case. In all the versions our accessor class is not based on _NormalAccessor.

Can you create a unit test or something that I can reproduce the issue? in my environment (on 0.3.2 version and also the latest) I'm unable to reproduce this scenario