This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhymes
Recipients rhymes
Date 2008-06-10.10:11:37
SpamBayes Score 0.002654096
Marked as misclassified No
Message-id <1213092703.97.0.622811170151.issue3073@psf.upfronthosting.co.za>
In-reply-to
Content
It seems the Cookie module has an odd behavior with whitespaces.
According to http://wp.netscape.com/newsref/std/cookie_spec.html and
http://en.wikipedia.org/wiki/HTTP_cookie#Cookie_attributes the 'Expires'
attribute of the cookie should have this format:

"Wdy, DD-Mon-YYYY HH:MM:SS GMT"

and this is recognized by all the browsers. The oddity comes when I try
to load or create a cookie with that attribute:

Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from Cookie import SimpleCookie
>>> cookies = SimpleCookie()
>>> cookies.load('foo=baz; expires=Sat, 10-Jun-1978 09:41:04 GMT')
>>> cookies
<SimpleCookie: foo='baz'>
>>> cookies['foo']['expires']
'Sat,'
>>> cookies.load('foo=baz; expires=2008-06-10T09:44:45.963024')
>>> cookies['foo']['expires']
'2008-06-10T09:44:45.963024'

It really seems the parser breaks on whitespaces.
History
Date User Action Args
2008-06-10 10:11:45rhymessetspambayes_score: 0.0026541 -> 0.002654096
recipients: + rhymes
2008-06-10 10:11:44rhymessetspambayes_score: 0.0026541 -> 0.0026541
messageid: <1213092703.97.0.622811170151.issue3073@psf.upfronthosting.co.za>
2008-06-10 10:11:41rhymeslinkissue3073 messages
2008-06-10 10:11:39rhymescreate