Fix for bug 1148: str/bytes issue in httplib's _safe_read().

This commit is contained in:
Guido van Rossum 2007-09-12 19:43:09 +00:00
parent 138bcb569e
commit a00f123706
2 changed files with 2 additions and 2 deletions

View File

@ -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:

View File

@ -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()