curl-and-python
Re: TypeError: invalid arguments to setopt
Date: Wed, 18 Jul 2007 16:01:46 +0200
hi,
i'll try improving the error message from pycurl a bit, for instance
by stating the desired type and the type of the input object.
regards,
- kjetil
On 7/17/07, Michael Sanders <m.r.sanders_at_gmail.com> wrote:
> I've just spent a day battling with the error:
>
> TypeError: invalid arguments to setopt
>
> It turns out that the URL I was setting with 'conn.setopt(conn.URL,url)'
> was a unicode object and not a string. I hadn't expected it to be
> Unicode and so spent a while scratching my head (and compiling up the
> latest version of pycurl, etc.) before I decided to examine the type of
> the object being passed! With hindsight, this should have been one of
> the first things I checked, but I didn't ;-)
>
> So to re-iterate - make sure the URL you pass is a string object and not
> unicode. Just thought I'd flag it up in case anyone else encounters this...
>
> Michael
> _______________________________________________
> 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-07-18