[issue12144] cookielib.CookieJar.make_cookies fails for cookies with 'expires' set

Scott Wimer report at bugs.python.org
Sun May 22 04:58:45 CEST 2011


New submission from Scott Wimer <scott.wimer at gmail.com>:

When cookielib.CookieJar().make_cookies is used to extract cookies from a urllib2 response, it crashes when it encounters a 'Set-Cookie' header entry that has an 'expires' attribute.

This crash occurs because the expires time is evaluated against the '_now' attribute of the CookieJar instance -- an attribute which is not set unless CookieJar().extract_cookies() was called previously.

Attached is a script that triggers this bug.

----------
components: Library (Lib)
files: cookielib-crash.py
messages: 136497
nosy: Scott.Wimer
priority: normal
severity: normal
status: open
title: cookielib.CookieJar.make_cookies fails for cookies with 'expires' set
type: crash
versions: Python 2.6
Added file: http://bugs.python.org/file22054/cookielib-crash.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12144>
_______________________________________


More information about the Python-bugs-list mailing list