s4cmd
s4cmd copied to clipboard
Trying to set metadata results in error (Python 3)
When trying to set metadata for a set of files I want to upload, I get the following error:
[Exception] 'dict' object has no attribute 'iteritems'
Exception in thread Thread-1:ad(s)]
Traceback (most recent call last):
File "/home/username/.local/bin/s4cmd.py", line 520, in run
self.__class__.__dict__[func_name](self, *args, **kargs)
File "/home/username/.local/bin/s4cmd.py", line 129, in wrapper
ret = func(*args, **kargs)
File "/home/username/.local/bin/s4cmd.py", line 1332, in upload
self.s3.put_object(Bucket=s3url.bucket,
File "/home/username/.local/bin/s4cmd.py", line 399, in wrapped_method
merged_kargs = self.merge_opt_params(method, kargs)
File "/home/username/.local/bin/s4cmd.py", line 432, in merge_opt_params
for k, v in getattr(self.opt, key).iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'
[...]
.iteritems
has been removed from dict
in Python 3.
I tried just changing it locally to .items
and that worked, but I'd rather let you fix it :)