GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — docs(commits): fix commit create example for binary content · mkarthiatgithub/python-gitlab@bcc1eb4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • docs/gl_objects
    • commits.rst
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎docs/gl_objects/commits.rst‎

Copy file name to clipboardExpand all lines: docs/gl_objects/commits.rst
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Create a commit::
4848
# Binary files need to be base64 encoded
4949
'action': 'create',
5050
'file_path': 'logo.png',
51-
'content': base64.b64encode(open('logo.png').read()),
51+
'content': base64.b64encode(open('logo.png', mode='r+b').read()).decode(),
5252
'encoding': 'base64',
5353
}
5454
]

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.