Restore RawResponse speed
RawResponse uses response.body from requests, which is pathologically
slow due to chardet (requests#2359). Since we're only interested in the
bytes, using response.content is faster. On a 3Mib file, this makes
a download_object() go from 40s to 4s.
Closes
@@ -278,7 +278,7 @@ class RawResponse(Response):
if not self._response:
response = self.connection.connection.getresponse()
self._response = HttpLibResponseProxy(response)
- self.body = response.text
+ self.body = response.content
if not self.success():
self.parse_error()
return self._response
