3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/python-modules/boto/content-length-str.patch
Benjamin Staffin 5113a065d7 boto: Apply patch needed to fix docker-registry
This makes docker-registry work when backed by S3. It's the same patch
applied in the docker upstream container image.

Backported from boto/boto#2932
2015-03-07 14:06:08 -08:00

17 lines
651 B
Diff

Cherry-picked from https://github.com/boto/boto/pull/2932
This fix is required for things like docker-registry to interact with S3. Will
be obsolete after the next boto release (> 2.36.0)
--- a/boto/connection.py
+++ b/boto/connection.py
@@ -381,7 +381,7 @@ class HTTPRequest(object):
if 'Content-Length' not in self.headers:
if 'Transfer-Encoding' not in self.headers or \
self.headers['Transfer-Encoding'] != 'chunked':
- self.headers['Content-Length'] = len(self.body)
+ self.headers['Content-Length'] = str(len(self.body))
class HTTPResponse(http_client.HTTPResponse):