xml-rpc UnicodeDecodeError

Discussion in 'Python' started by timothee cezard, Jun 10, 2010.

  1. 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.
     
    timothee cezard, Jun 10, 2010
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pere Montolio

    XML RPC to ONC XDR RPC

    Pere Montolio, Aug 11, 2004, in forum: XML
    Replies:
    0
    Views:
    758
    Pere Montolio
    Aug 11, 2004
  2. Ruslan
    Replies:
    1
    Views:
    515
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Sep 7, 2004
  3. Ymtrader
    Replies:
    1
    Views:
    605
    Adam Tauno Williams
    Mar 15, 2011
  4. Shirish Joshi

    Ruby and Sun-RPC or ONC-RPC ?

    Shirish Joshi, Apr 7, 2004, in forum: Ruby
    Replies:
    0
    Views:
    219
    Shirish Joshi
    Apr 7, 2004
  5. Vladimir Konrad

    rpc (not xml-rpc)

    Vladimir Konrad, Sep 2, 2005, in forum: Ruby
    Replies:
    5
    Views:
    149
    Austin Ziegler
    Sep 3, 2005
Loading...

Share This Page