handle binary stream from urllib.request.urlopen

Python 3 returns bytes by default with urlopen.  Adjust our code to
handle that scenario and decode as necessary.

Bug: https://crbug.com/gerrit/10418
Change-Id: Icf4cd80e7ef92d71a3eefbc6113f1ba11c32eebc
This commit is contained in:
Mike Frysinger
2019-07-04 17:54:54 -04:00
parent 3698ab7c92
commit 1b9adab75a
2 changed files with 3 additions and 2 deletions

2
repo
View File

@@ -583,7 +583,7 @@ def _DownloadBundle(url, local, quiet):
print('Get %s' % url, file=sys.stderr)
while True:
buf = r.read(8192)
if buf == '':
if not buf:
return True
dest.write(buf)
finally: