Passing a CookieJar instead of a cookieproc to urllib2.build_opener

rrenaud at gmail.com rrenaud at gmail.com
Wed Jul 11 18:40:43 CEST 2007


On Jul 10, 11:10 pm, j... at pobox.com (John J. Lee) wrote:
> "rren... at gmail.com" <rren... at gmail.com> writes:
> > 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?
>
> IMO, it's worth filing iff:
>
> a) you think it's worthwhile (this one sounds worthwhile to me)
>
> b) you write a patch and are prepared to patiently keep at it until it
> gets applied
>
> Make sure your patch follows PEP 8.  Make sure the patch includes test
> and documentation updates / additions (you don't need to write docs in
> LaTeX format -- other people will do the conversion to LaTeX for you
> if you like).  If there are no doc changes required, state that
> explicitly in the patch tracker.  If your patch gets ignored, review
> five other patches, and post to python-dev stating you have done so
> and requesting that your patch is reviewed (there's a shortage of
> patch reviewers).
>
> John

The patch is on the tracker here.
http://sourceforge.net/tracker/index.php?func=detail&aid=1750931&group_id=5470&atid=305470

Are the docs themselves in subversion?  I suppose I should also update
the doc at http://docs.python.org/lib/module-urllib2.html




More information about the Python-list mailing list