[Python-checkins] r77837 - in python/branches/release26-maint: Doc/library/xmlrpclib.rst

victor.stinner python-checkins at python.org
Sat Jan 30 03:04:58 CET 2010


Author: victor.stinner
Date: Sat Jan 30 03:04:58 2010
New Revision: 77837

Log:
Merged revisions 77836 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77836 | victor.stinner | 2010-01-30 03:00:26 +0100 (sam., 30 janv. 2010) | 2 lines
  
  #7801: fix xmlrpclib binary example, open the picture in binary mode
........


Modified:
   python/branches/release26-maint/   (props changed)
   python/branches/release26-maint/Doc/library/xmlrpclib.rst

Modified: python/branches/release26-maint/Doc/library/xmlrpclib.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/xmlrpclib.rst	(original)
+++ python/branches/release26-maint/Doc/library/xmlrpclib.rst	Sat Jan 30 03:04:58 2010
@@ -318,7 +318,7 @@
    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 @@
    import xmlrpclib
 
    proxy = xmlrpclib.ServerProxy("http://localhost:8000/")
-   with open("fetched_python_logo.jpg", "w") as handle:
+   with open("fetched_python_logo.jpg", "wb") as handle:
        handle.write(proxy.python_logo().data)
 
 .. _fault-objects:


More information about the Python-checkins mailing list