Issue 15080: Cookie library doesn't parse date properly (original) (raw)

Issue15080

Created on 2012-06-15 20:20 by jgillick, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (4)
msg162932 - (view) Author: Jeremy Gillick (jgillick) Date: 2012-06-15 20:20
The cookie library doesn't seem to support the standard date format (RFC 822) for the expire property while parsing a cookie. For example, in the Python prompt: >>> import Cookie >>> cookie = Cookie.SimpleCookie('bcookie="123"; Expires=Sat, 14-Jun-2014 23:03:13 GMT;') >>> cookie['bcookie']['expires'] 'Sat,' That is a standard header, but it only processes the date up to the first space.
msg162935 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2012-06-15 20:55
2.6.8 is the latest source-only release of the 2.6 series. Here's what I get: Python 2.6.8 (unknown, Jun 15 2012, 15:51:46) [GCC 4.5.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import Cookie >>> cookie = Cookie.SimpleCookie('bcookie="123"; Expires=Sat, 14-Jun-2014 23:03:13 GMT;') >>> cookie['bcookie']['expires'] 'Sat, 14-Jun-2014 23:03:13 GMT' Jeremy, what is the exact version of 2.6 being used?
msg162936 - (view) Author: Jeremy Gillick (jgillick) Date: 2012-06-15 21:09
I'm using Python 2.6.1
msg163530 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2012-06-23 05:01
Jeremy, when reporting bugs, please first check the latest release. This works in current 2.7.3 (as well as latest 2.6.8 and 3.3.0). >>> import Cookie >>> cookie = Cookie.SimpleCookie('bcookie="123"; Expires=Sat, 14-Jun-2014 23:03:13 GMT;') >>> cookie['bcookie']['expires'] 'Sat, 14-Jun-2014 23:03:13 GMT' 2.6 only gets security patches. There have been as least a thousand patches since 2.6.1 and this is one of them.
History
Date User Action Args
2022-04-11 14:57:31 admin set github: 59285
2012-06-23 05:01:01 terry.reedy set status: open -> closednosy: + terry.reedymessages: + resolution: out of date
2012-06-15 21:09:30 jgillick set messages: +
2012-06-15 20:55:18 roger.serwy set nosy: + roger.serwymessages: +
2012-06-15 20:20:55 jgillick create