Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > xml-rpc UnicodeDecodeError

Reply
Thread Tools

xml-rpc UnicodeDecodeError

 
 
timothee cezard
Guest
Posts: n/a
 
      06-10-2010
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


--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
UnicodeDecodeError ash Python 5 12-02-2005 07:33 AM
[pysqlite 2.0.2] UnicodeDecodeError: 'utf8' codec can't decode bytes in position 44-45: invalid data F. GEIGER Python 0 05-27-2005 07:29 PM
UnicodeDecodeError Thomas Thomas Python 2 05-05-2005 02:48 AM
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 10: ordinal not in range(128) Robin Siebler Python 4 10-08-2004 08:03 PM
minidom's setAttribute + UnicodeDecodeError Ruslan Python 1 09-07-2004 08:33 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57