curl-and-python

Re: pycurl.POSTFIELDS in xmlrpc_curl.py

From: Kjetil Jacobsen <kjetilja_at_gmail.com>
Date: Sun, 4 Mar 2007 20:22:55 +0100

hi,

failed on python 2.5 with me but not within libcurl:
"""
<ServerProxy for betty.userland.com/RPC2>
Traceback (most recent call last):
  File "xmlrpc_curl.py", line 59, in <module>
    print server.examples.getStateName(41)
  File "/usr/local/lib/python2.5/xmlrpclib.py", line 1147, in __call__
    return self.__send(self.__name, args)
  File "/usr/local/lib/python2.5/xmlrpclib.py", line 1437, in __request
    verbose=self.__verbose
  File "xmlrpc_curl.py", line 50, in request
    return self.parse_response(b)
  File "/usr/local/lib/python2.5/xmlrpclib.py", line 1309, in parse_response
    return self._parse_response(file, None)
  File "/usr/local/lib/python2.5/xmlrpclib.py", line 1324, in _parse_response
    p, u = self.getparser()
  File "/usr/local/lib/python2.5/xmlrpclib.py", line 1210, in getparser
    return getparser(use_datetime=self._use_datetime)
AttributeError: CURLTransport instance has no attribute '_use_datetime'
"""

seems like xmlrpc transports in 2.5 require the attribute
_use_datetime to be set, so i've updated pycurl to reflect this.

regards,
    - kjetil

On 2/22/07, Mark Eichin <eichin_at_gmail.com> wrote:
> Works with the ubuntu versions (which also means that
> betty.userland.com is up) but that's 7.15.0 and python2.4.
>
> On 2/21/07, Andreas Köhler <andi5.py_at_gmx.net> wrote:
> > Hi,
> >
> > i am unable to successfully run xmlrpc_curl.py from
> > http://pycurl.cvs.sourceforge.net/*checkout*/pycurl/pycurl/examples/xmlrpc_curl.py?revision=1.12&content-type=text%2Fplain
> >
> > >>> python xmlrpc_curl.py
> > <ServerProxy for betty.userland.com/RPC2>
> > Traceback (most recent call last):
> > File "xmlrpc_curl.py", line 59, in <module>
> > print server.examples.getStateName(41)
> > File "/usr/lib/python2.5/xmlrpclib.py", line 1147, in __call__
> > return self.__send(self.__name, args)
> > File "/usr/lib/python2.5/xmlrpclib.py", line 1437, in __request
> > verbose=self.__verbose
> > File "xmlrpc_curl.py", line 38, in request
> > self.c.setopt(pycurl.POSTFIELDS, request_body)
> > pycurl.error: (2, '')
> >
> > >>> dpkg -l libcurl3 python-pycurl python2.5
> > ii libcurl3 7.15.5-1ubuntu1
> > ii python-pycurl 7.15.5-1ubuntu1
> > ii python2.5 2.5-5ubuntu7
> >
> > I also compiled the latest libcurl release and pycurl HEAD to no avail.
> > IIRC, there was some issue in src/pycurl.c : do_curl_setopt : case
> > CURLOPT_POSTFIELDS, where PyString_AsStringAndSize cleared `option' for
> > whatever reason.
> >
> > -- andi5
> >
> >
> > _______________________________________________
> > http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
> >
>
>
> --
> _Mark_ <eichin_at_thok.org> <eichin_at_gmail.com>
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
>

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2007-03-04