summaryrefslogtreecommitdiffstats
path: root/Lib/http
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-10-03 18:22:42 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2010-10-03 18:22:42 (GMT)
commit58d5dbf80b8506e9f861c966125b023e591b682f (patch)
tree6b08634d70d2c2ee2099a6e1500b9cb0cf48bca1 /Lib/http
parent4271372a7145fe4a8e44982e5b89c3c7e3637c8e (diff)
downloadcpython-58d5dbf80b8506e9f861c966125b023e591b682f.zip
cpython-58d5dbf80b8506e9f861c966125b023e591b682f.tar.gz
cpython-58d5dbf80b8506e9f861c966125b023e591b682f.tar.bz2
Fix Issue10012 - httplib headers, which are (sometimes mistakenly) int are explicitly cast to str (bytes - in py3k).
Diffstat (limited to 'Lib/http')
-rw-r--r--Lib/http/client.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py
index 2799c07..34c098d 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -917,6 +917,8 @@ class HTTPConnection:
for i, one_value in enumerate(values):
if hasattr(one_value, 'encode'):
values[i] = one_value.encode('ascii')
+ elif isinstance(one_value, int):
+ values[i] = str(one_value).encode('ascii')
value = b'\r\n\t'.join(values)
header = header + b': ' + value
self._output(header)