diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2016-11-01 14:38:58 +0100 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2016-11-01 14:38:58 +0100 |
commit | ca014f8c3e4877a4cc1ae04e1302fb57d39f47c4 (patch) | |
tree | cef16168d42be6cb7d7bfcbc703d01991b8c021b /docs/gl_objects/projects.py | |
parent | 4689e73b051fa985168cb648f49ee2dd6b6df523 (diff) | |
download | gitlab-ca014f8c3e4877a4cc1ae04e1302fb57d39f47c4.tar.gz |
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
Diffstat (limited to 'docs/gl_objects/projects.py')
-rw-r--r-- | docs/gl_objects/projects.py | 4 |
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 |