Merged revisions 75134 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r75134 | antoine.pitrou | 2009-09-29 19:48:18 +0200 (mar., 29 sept. 2009) | 4 lines
Issue #6790: Make it possible again to pass an `array.array` to
`httplib.HTTPConnection.send`. Patch by Kirk McDonald.
........
diff --git a/Lib/httplib.py b/Lib/httplib.py
index 3566c0e..3623bc3 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -66,6 +66,7 @@
Req-sent-unread-response _CS_REQ_SENT <response_class>
"""
+from array import array
import socket
from sys import py3kwarning
from urlparse import urlsplit
@@ -732,7 +733,7 @@
print "send:", repr(str)
try:
blocksize=8192
- if hasattr(str,'read') :
+ if hasattr(str,'read') and not isinstance(str, array):
if self.debuglevel > 0: print "sendIng a read()able"
data=str.read(blocksize)
while data: