(?P<val> # Start of group 'val'
"(?:[^\\"]|\\.)*" # Any doublequoted string
| # or
+ \w{3},\s[\w\d-]{9,11}\s[\d:]{8}\sGMT # Special case for "expires" attr
+ | # or
""" + _LegalCharsPatt + r"""* # Any word or empty string
) # End of group 'val'
\s*;? # Probably ending in a semi-colon
# can't test exact output, it always depends on current date/time
self.assertTrue(C.output().endswith('GMT'))
+ # loading 'expires'
+ C = cookies.SimpleCookie()
+ C.load('Customer="W"; expires=Wed, 01-Jan-2010 00:00:00 GMT')
+ self.assertEqual(C['Customer']['expires'],
+ 'Wed, 01-Jan-2010 00:00:00 GMT')
+ C = cookies.SimpleCookie()
+ C.load('Customer="W"; expires=Wed, 01-Jan-98 00:00:00 GMT')
+ self.assertEqual(C['Customer']['expires'],
+ 'Wed, 01-Jan-98 00:00:00 GMT')
+
# 'max-age'
C = cookies.SimpleCookie('Customer="WILE_E_COYOTE"')
C['Customer']['max-age'] = 10
Library
-------
+- Issue #8826: Properly load old-style "expires" attribute in http.cookies.
+
- Issue #1690103: Fix initial namespace for code run with trace.main().
- Issue #7395: Fix tracebacks in pstats interactive browser.