xmlrpclib/timeoutsocket not happy together in 2.3

Discussion in 'Python' started by Larry, Sep 16, 2003.

  1. Larry

    Larry Guest

    I've had a production system running for a long time that uses
    xmlrpclib with timeoutsocket, and with my recent upgrade to 2.3 it's
    no longer able to use xmlrpclib with the xmlrpc servers I communicate
    with. I can call remote procedures still, but as soon as I import
    timeoutsocket and the old socket switcharoo is done it's over.

    To add to the fun I can use xmlrpc w/timeoutsocket if calling
    functions at the ubiquitous betty.userland.com example, but not the
    servers I've been talking to for the last two years. Example:

    Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on
    win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import xmlrpclib
    >>> s=xmlrpclib.Server('http://myrpcserver/server')
    >>> s.version()

    22
    >>> s.localTime()

    '9/16/2003 12:16:38 PM'
    >>> import timeoutsocket
    >>> s.version()

    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "C:\Python23\lib\xmlrpclib.py", line 1029, in __call__
    return self.__send(self.__name, args)
    File "C:\Python23\lib\xmlrpclib.py", line 1316, in __request
    verbose=self.__verbose
    File "C:\Python23\lib\xmlrpclib.py", line 1080, in request
    return self._parse_response(h.getfile(), sock)
    File "C:\Python23\lib\xmlrpclib.py", line 1217, in _parse_response
    p.close()
    File "C:\Python23\lib\xmlrpclib.py", line 531, in close
    self._parser.Parse("", 1) # end of data
    xml.parsers.expat.ExpatError: no element found: line 1, column 0
    >>> s.localTime()

    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "C:\Python23\lib\xmlrpclib.py", line 1029, in __call__
    return self.__send(self.__name, args)
    File "C:\Python23\lib\xmlrpclib.py", line 1316, in __request
    verbose=self.__verbose
    File "C:\Python23\lib\xmlrpclib.py", line 1080, in request
    return self._parse_response(h.getfile(), sock)
    File "C:\Python23\lib\xmlrpclib.py", line 1217, in _parse_response
    p.close()
    File "C:\Python23\lib\xmlrpclib.py", line 531, in close
    self._parser.Parse("", 1) # end of data
    xml.parsers.expat.ExpatError: no element found: line 1, column 0
    >>> s=xmlrpclib.Server('http://betty.userland.com')
    >>> s.examples.getStateName(41)

    'South Dakota'

    Obviously the bad element here is the remote servers I communicate
    with since userland works, but this just started with 2.3 and I'm
    curious if anyone else has had a similar problem before I start
    digging into this.

    Thanks.

    - Larry
     
    Larry, Sep 16, 2003
    #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. Gilles Lenfant

    timeoutsocket.py

    Gilles Lenfant, Oct 31, 2003, in forum: Python
    Replies:
    8
    Views:
    539
    Gilles Lenfant
    Nov 4, 2003
  2. Raja
    Replies:
    0
    Views:
    318
  3. Replies:
    4
    Views:
    328
  4. Joe Ardent
    Replies:
    4
    Views:
    366
    Gabriel Genellina
    May 28, 2007
  5. Daniel Martin
    Replies:
    1
    Views:
    177
    Daniel Martin
    Sep 6, 2006
Loading...

Share This Page