Skip to content

Commit

Permalink
docs: add a note for python 3.5 for file content update
Browse files Browse the repository at this point in the history
The data passed to the JSON serializer must be a string with python 3.
Document this in the exemples.

Fix #175
  • Loading branch information
Gauvain Pocentek committed Nov 1, 2016
1 parent 4689e73 commit ca014f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/gl_objects/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,9 @@
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

Expand Down

0 comments on commit ca014f8

Please sign in to comment.