From ca014f8c3e4877a4cc1ae04e1302fb57d39f47c4 Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Tue, 1 Nov 2016 14:38:58 +0100 Subject: 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 --- docs/gl_objects/projects.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'docs/gl_objects') 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 -- cgit v1.2.1