diff --git a/glanceclient/common/utils.py b/glanceclient/common/utils.py index c36c58f5..2bdca0a3 100644 --- a/glanceclient/common/utils.py +++ b/glanceclient/common/utils.py @@ -283,6 +283,8 @@ def save_image(data, path): :param path: path to save the image to """ if path is None: + # NOTE(kragniz): for py3 compatibility: sys.stdout.buffer is only + # present on py3, otherwise fall back to sys.stdout image = getattr(sys.stdout, 'buffer', sys.stdout) else: