Passing a CookieJar instead of a cookieproc to urllib2.build_opener

rrenaud at gmail.com rrenaud at gmail.com
Tue Jul 10 02:45:31 CEST 2007


urllib2.build_opener happily accepts and ignores a FileCookieJar.    I
had a bug in my code which looked like

urllib2.build_opener(func_returning_cookie_jar())

which should have been

urllib2.build_opener(HTTPCookieProcessor(func_returning_cookie_jar())

The problem is that the code ran happily without actually sending the
cookie, the CookieJar was just ignored.  I think that build_opener
should throw an exception when add_handler doesn't actually add.

Is this worth filing a bug for, or is it acceptable behavior?




More information about the Python-list mailing list