curl-and-python

TypeError: invalid arguments to setopt

From: Michael Sanders <m.r.sanders_at_gmail.com>
Date: Tue, 17 Jul 2007 10:49:56 +0100

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
Received on 2007-07-17