XMLRPC and unicode

magnus_heino at my-deja.com magnus_heino at my-deja.com
Thu Nov 2 04:16:57 EST 2000


Hi.

I am using medusa and its xmlrpc_handler as a server. It is working just
fine.


However, if the type of the value returned from the server is of type
unicode, the client side fails.

Example:

Python 2.0 (#3, Oct 30 2000, 08:24:02)
[GCC 2.96 20000731 (Red Hat Linux 7.0)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> import xmlrpclib
>>> server = xmlrpclib.Server('http://daysleeper:8000')
>>> server.getRandomUnicodeString()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "xmlrpclib.py", line 547, in __call__
    return self.__send(self.__name, args)
  File "xmlrpclib.py", line 630, in __request
    request
  File "xmlrpclib.py", line 582, in request
    headers
xmlrpclib.ProtocolError: <ProtocolError for daysleeper:8000/RPC2: 500
nternal Server Error>



If the server returns the string as a type string instead of type unicode
then everything works, but that is not what I want to do.

Has anyone seen this before of got a suggestion of something to try?

/Magnus Heino


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list