py3: Fix encoding and use sys.stdin.buffer

* exc.py: Encode body in response before calling replace over it.
* http.py: prepend the bytes literal to the empty string or else
  we hit bug 1342080 again in python 3.
* utils.py: Use sys.stdin.buffer in python 3.

Change-Id: Ieefb8c633658e507486438e5518c5d53e819027d
This commit is contained in:
Sirushti Murugesan
2016-06-23 19:08:51 +05:30
parent a0d1cc974e
commit 376037d371
6 changed files with 28 additions and 5 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ class _BaseHTTPClient(object):
chunk = body
while chunk:
chunk = body.read(CHUNKSIZE)
if chunk == '':
if not chunk:
break
yield chunk