bytearray not handled correctly as content (but bytes is)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-swiftclient |
New
|
Undecided
|
Unassigned |
Bug Description
Attempting PUT_OBJECT with content of type 'bytes' is handled correctly.
With the check in client.py:1317, the iter_wrapper is not used for bytes.
However, the check does not include bytearray - hence the iter_wrapper is used, and fails, because the iterated items in bytearray are themselves integers, not arrays of bytes.
'bytearray' should be handled the same way as 'bytes'.
Stack trace looks like this:
File "/usr/local/
response_
File "/usr/local/
service_
File "/usr/local/
conn.
File "/usr/local/
files=files, **self.
File "/usr/local/
return self.request_
File "/usr/local/
resp = self.send(prep, **send_kwargs)
File "/usr/local/
r = adapter.
File "/usr/local/
for i in request.body:
File "/usr/local/
if len(chunk) == 0: