summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/gl_objects/projects.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/docs/gl_objects/projects.py b/docs/gl_objects/projects.py
index c2bc5aa..ed99cec 100644
--- a/docs/gl_objects/projects.py
+++ b/docs/gl_objects/projects.py
@@ -229,7 +229,9 @@ f.content = 'new content'
f.save(branch_name='master', commit_message='Update testfile')
# or for binary data
-f.content = base64.b64encode(open('image.png').read())
+# Note: decode() is required with python 3 for data serialization. You can omit
+# it with python 2
+f.content = base64.b64encode(open('image.png').read()).decode()
f.save(branch_name='master', commit_message='Update testfile', encoding='base64')
# end files update