summaryrefslogtreecommitdiff
path: root/openstackclient/api
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/api')
-rw-r--r--openstackclient/api/object_store_v1.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/openstackclient/api/object_store_v1.py b/openstackclient/api/object_store_v1.py
index 31033525..d1e5dfaf 100644
--- a/openstackclient/api/object_store_v1.py
+++ b/openstackclient/api/object_store_v1.py
@@ -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: