Before writing object data to stdout, re-open it in binary mode
Otherwise, you can hit TypeErrors on Python3. Change-Id: I9a891508886feddac3982ce593bd95130392e035 Closes-Bug: 1775482
This commit is contained in:
@@ -378,8 +378,9 @@ class APIv1(api.BaseAPI):
|
||||
)
|
||||
if response.status_code == 200:
|
||||
if file == '-':
|
||||
for chunk in response.iter_content(64 * 1024):
|
||||
sys.stdout.write(chunk)
|
||||
with os.fdopen(sys.stdout.fileno(), 'wb') as f:
|
||||
for chunk in response.iter_content(64 * 1024):
|
||||
f.write(chunk)
|
||||
else:
|
||||
if not os.path.exists(os.path.dirname(file)):
|
||||
if len(os.path.dirname(file)) > 0:
|
||||
|
||||
Reference in New Issue
Block a user