UnboundLocalError on S3Bucket.listdir() method
Closed this issue · 0 comments
dahlia commented
S3Bucket.listdir()
method raises UnboundLocalError
. It seems to occur when its result list is empty, but I have no idea about its detail. What is next_marker
attribute for?
Traceback (most recent call last):
File "/.../app.py", line 134, in list_sizes
keys = list(self.bucket.listdir(prefix=prefix + '/'))
File "/home/styleshare/lib/python2.7/site-packages/simples3/bucket.py", line 395, in listdir
for item in listing:
File "/home/styleshare/lib/python2.7/site-packages/simples3/bucket.py", line 189, in __iter__
self.next_marker = item[0]
UnboundLocalError: local variable 'item' referenced before assignment