tempurl PUT/upload throws AttributeError about dict_items
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
A customer of ours was attempting to PUT files in a tempurl, which is supposed to be legal according to "/info".
However, the PUT failed with this backtrace:
Traceback (most recent call last):
File "eventlet/wsgi.py", line 573, in handle_one_response
result = self.applicatio
File "swift/
return context.
File "swift/
self.
AttributeError: 'dict_items' object has no attribute 'append'
The immediate cause is this:
- Append is attempted on something that is not a list
self.
...
self.
That is not legal in python3 (it was in python2).
I checked for .items() candidates, and there are few. At least:
swift/
self.
swift/
return headers.items()
And the latter makes the most sense, as the user was using the tempurl functionality.
And indeed, this patch fixes things:
```
--- swift/common/
+++ swift/common/
@@ -839,7 +839,7 @@ class TempURL(object):
- return headers.items()
+ return list(headers.
def filter_
```
Versions:
- swift 2.25.1, but according to git, nothing was changed between 2.25.1 and master
- python3.8, but that's irrelevant
Cheers,
Walter Doekes
OSSO B.V.
Fix proposed to branch: master /review. opendev. org/c/openstack /swift/ +/792397
Review: https:/