xml-rpc UnicodeDecodeError

T

timothee cezard

Hi all,
I'm starting to use xml-rpc module to check and potentially modify a
confluence wiki
but I'm getting and error on a page containing the pound (£) sign

here is the code I'm using

server = xmlrpclib.ServerProxy('my_server', verbose=True)
token = server.confluence1.login('username','password)
page = server.confluence1.getPage(token, spacekey, pagetitle)
print page['content']
I'm getting:
page = server.confluence1.getPage(token, spacekey, pagetitle)
File "/usr/lib/python2.6/xmlrpclib.py", line 1199, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.6/xmlrpclib.py", line 1489, in __request
verbose=self.__verbose
File "/usr/lib/python2.6/xmlrpclib.py", line 1253, in request
return self._parse_response(h.getfile(), sock)
File "/usr/lib/python2.6/xmlrpclib.py", line 1387, in _parse_response
p.feed(response)
File "/usr/lib/python2.6/xmlrpclib.py", line 868, in end
return f(self, join(self._data, ""))
File "/usr/lib/python2.6/xmlrpclib.py", line 959, in end_value
self.end_string(data)
File "/usr/lib/python2.6/xmlrpclib.py", line 916, in end_string
data = _decode(data, self._encoding)
File "/usr/lib/python2.6/xmlrpclib.py", line 164, in _decode
data = unicode(data, encoding)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xa3 in position
811: unexpected code byte


I tried changing the encoding to iso-8859-1
server = xmlrpclib.ServerProxy('my_server', encoding='iso-8859-1',
verbose=True)
token = server.confluence1.login('username','password)
page = server.confluence1.getPage(token, spacekey, pagetitle)
print page['content']
I'm getting the same exception

Does any of you have an idea of what I'm doing wrong?
I'm using Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) and xmlrpclib
version 1.0.1

Thanks

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top