Controlling source IP address within urllib2

Dan tojuso at hotmail.com
Wed Jun 8 17:49:59 EDT 2005


John,
Thanks again for your help!
I think that the do_open function in AbstractHTTPHandler does not
return the correct object type as required by the opener.  When I
include the code you recommended, the implementation comes back with
the message, "urlopen error unknown url type: http".  Strange, because
I would think that overriding the "http_open" function in the handler
would have signaled that this function is capable of handling http.  If
I call the HTTPHandler base class "http_open" function from within the
derived class, all works okay, but of course, I don't get to use the
source IP address I wanted to use.
I'll keep trying and let you know what I find.
-Dan




More information about the Python-list mailing list