Trying to set metadata results in error (Python 3)
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 209
- PR merge metrics
- No merged PRs in 30d
Description
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 :)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in s4cmd.py at merge_opt_params, around the traceback's line 432, and inspect how metadata options are iterated during upload. Verify the fix by reproducing a metadata upload under Python 3 and confirming it completes without the reported AttributeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100