mirror of https://github.com/python/cpython
Fix for bug 1148: str/bytes issue in httplib's _safe_read().
This commit is contained in:
parent
138bcb569e
commit
a00f123706
|
@ -624,7 +624,7 @@ class HTTPResponse:
|
|||
raise IncompleteRead(s)
|
||||
s.append(chunk)
|
||||
amt -= len(chunk)
|
||||
return "".join(s)
|
||||
return b"".join(s)
|
||||
|
||||
def getheader(self, name, default=None):
|
||||
if self.msg is None:
|
||||
|
|
|
@ -133,7 +133,7 @@ class BasicTest(TestCase):
|
|||
NoEOFStringIO)
|
||||
resp = httplib.HTTPResponse(sock, method="HEAD")
|
||||
resp.begin()
|
||||
if resp.read() != "":
|
||||
if resp.read():
|
||||
self.fail("Did not expect response from HEAD request")
|
||||
resp.close()
|
||||
|
||||
|
|
Loading…
Reference in New Issue