Browse code

* S3/S3.py: "Stringify" all headers. Httplib should do it but some Python 2.7 users reported problems that should now be fixed.

git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@438 830e0280-6d2a-0410-9c65-932aecc39d9d

Michal Ludvig authored on 2010/10/24 17:34:43
Showing 2 changed files
... ...
@@ -1,3 +1,9 @@
1
+2010-10-24  Michal Ludvig  <mludvig@logix.net.nz>
2
+
3
+	* S3/S3.py: "Stringify" all headers. Httplib should do
4
+	  it but some Python 2.7 users reported problems that should
5
+	  now be fixed.
6
+
1 7
 2010-07-25  Aaron Maxwell  <amax@resymbol.net>
2 8
 
3 9
 	* S3/Config.py, testsuite/etc/brokenlink.png, testsuite/etc/more/linked-dir, testsuite/etc/more/give-me-more.txt, testsuite/etc/linked.png, testsuite/etc/linked1.png, run-tests.py, s3cmd.1, s3cmd:
... ...
@@ -466,6 +466,9 @@ class S3(object):
466 466
 		if not headers.has_key('content-length'):
467 467
 			headers['content-length'] = body and len(body) or 0
468 468
 		try:
469
+			# "Stringify" all headers
470
+			for header in headers.keys():
471
+				headers[header] = str(headers[header]))
469 472
 			conn = self.get_connection(resource['bucket'])
470 473
 			conn.request(method_string, self.format_uri(resource), body, headers)
471 474
 			response = {}