Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
75d3fb1e
Commit
75d3fb1e
authored
Jan 30, 2010
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#7801: fix xmlrpclib binary example, open the picture in binary mode
parent
721caaa9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
Doc/library/xmlrpclib.rst
Doc/library/xmlrpclib.rst
+2
-2
No files found.
Doc/library/xmlrpclib.rst
View file @
75d3fb1e
...
...
@@ -318,7 +318,7 @@ XMLRPC::
import xmlrpclib
def python_logo():
with open("python_logo.jpg") as handle:
with open("python_logo.jpg"
, "rb"
) as handle:
return xmlrpclib.Binary(handle.read())
server = SimpleXMLRPCServer(("localhost", 8000))
...
...
@@ -332,7 +332,7 @@ The client gets the image and saves it to a file::
import xmlrpclib
proxy = xmlrpclib.ServerProxy("http://localhost:8000/")
with open("fetched_python_logo.jpg", "w") as handle:
with open("fetched_python_logo.jpg", "w
b
") as handle:
handle.write(proxy.python_logo().data)
.. _fault-objects:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment