Skip to content

Commit ca014f8

Browse files
author
Gauvain Pocentek
committed
docs: add a note for python 3.5 for file content update
The data passed to the JSON serializer must be a string with python 3. Document this in the exemples. Fix #175
1 parent 4689e73 commit ca014f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/gl_objects/projects.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,9 @@
229229
f.save(branch_name='master', commit_message='Update testfile')
230230

231231
# or for binary data
232-
f.content = base64.b64encode(open('image.png').read())
232+
# Note: decode() is required with python 3 for data serialization. You can omit
233+
# it with python 2
234+
f.content = base64.b64encode(open('image.png').read()).decode()
233235
f.save(branch_name='master', commit_message='Update testfile', encoding='base64')
234236
# end files update
235237

0 commit comments

Comments
 (0)