Author mnewman
Recipients georg.brandl, mnewman
Date 2010-01-29.00:21:13
SpamBayes Score 2.01882e-09
Marked as misclassified No
Message-id <>
In Section 20.23.3 Binary Objects of:

The server AND client examples fail because the read and write methods are not set to binary mode.

Example of what the client portion shows if you use the examples "as is" with Python 3.1.1 (r311:74483) on win32:

Traceback (most recent call last):
  File "", line 10, in <module>
  File "C:\python31\lib\xmlrpc\", line 1029, in __call__
    return self.__send(self.__name, args)
  File "C:\python31\lib\xmlrpc\", line 1271, in __request
  File "C:\python31\lib\xmlrpc\", line 1070, in request
    return self.parse_response(resp)
  File "C:\python31\lib\xmlrpc\", line 1169, in parse_response
    return u.close()
  File "C:\python31\lib\xmlrpc\", line 673, in close
    raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault 1: "<class 'UnicodeDecodeError'>:'charmap' codec can't decode byte 0x81 in position 297: character maps to <undefined>">

To fix it, the server example should have:

handle = open("python_logo.jpg", "rb")

and the client example should have:

handle = open("fetched_python_logo.jpg", "wb")
Date User Action Args
2010-01-29 00:21:16mnewmansetrecipients: + mnewman, georg.brandl
2010-01-29 00:21:16mnewmansetmessageid: <>
2010-01-29 00:21:14mnewmanlinkissue7801 messages
2010-01-29 00:21:13mnewmancreate