summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--releasenotes/notes/fix-job-binary-download-py3-5592eca2345305bd.yaml4
-rw-r--r--saharaclient/osc/v1/job_binaries.py2
2 files changed, 5 insertions, 1 deletions
diff --git a/releasenotes/notes/fix-job-binary-download-py3-5592eca2345305bd.yaml b/releasenotes/notes/fix-job-binary-download-py3-5592eca2345305bd.yaml
new file mode 100644
index 0000000..5b33fa8
--- /dev/null
+++ b/releasenotes/notes/fix-job-binary-download-py3-5592eca2345305bd.yaml
@@ -0,0 +1,4 @@
+---
+fixes:
+ - |
+ Fix the "job binary download" command when Python 3 is used.
diff --git a/saharaclient/osc/v1/job_binaries.py b/saharaclient/osc/v1/job_binaries.py
index 8333c27..0d5fcbe 100644
--- a/saharaclient/osc/v1/job_binaries.py
+++ b/saharaclient/osc/v1/job_binaries.py
@@ -506,7 +506,7 @@ class DownloadJobBinary(command.Command):
client.job_binaries, parsed_args.job_binary)
data = client.job_binaries.get_file(jb_id)
- with open(parsed_args.file, 'w') as f:
+ with open(parsed_args.file, 'wb') as f:
f.write(data)
sys.stdout.write(
'Job binary "{jb}" has been downloaded '