crash on content-encoding:gzip http responses
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-swiftclient |
Fix Released
|
Undecided
|
Unassigned | ||
python-swiftclient (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Trusty |
Confirmed
|
Undecided
|
Unassigned | ||
Utopic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Versions:
python-
requests==2.2.1
python-swiftclient cannot seem to handle gziped http response.
DEBUG:swiftclie
DEBUG:swiftclie
Traceback (most recent call last):
File "./bin/swift", line 1488, in <module>
globals(
File "./bin/swift", line 592, in st_list
prefix=
File "/dev/python/
full_
File "/dev/python/
rv = func(self.url, self.token, *args, **kwargs)
File "/dev/python/
return resp_headers, json_loads(body)
File "/dev/python/
return _default_
File "/dev/python/
obj, end = self.raw_decode(s)
File "/dev/python/
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.
HTTP requests are made through the HTTPConnection class, which is a wrapper around python-requests mimicking the httplib API ?..
A way to fix this would be to let urllib do the decoding by passing decode_content=True in HTTPConnection.
- self.resp.read = self.resp.raw.read
+ self.resp.read = functools.
return self.resp
The other way would be to let every function using HTTPConnection.
Changed in python-swiftclient (Ubuntu Utopic): | |
status: | Confirmed → Fix Released |
Changed in python-swiftclient (Ubuntu Trusty): | |
status: | New → Confirmed |
Changed in python-swiftclient: | |
status: | New → Fix Released |
I'm using duplicity on swift container which uses python-swiftclient.
It fails only on gzip/encrypted data in containers.