(?x) # This is a verbose pattern
\s* # Optional whitespace at start of cookie
(?P<key> # Start of group 'key'
- """ + _LegalCharsPatt + r"""+? # Any word of at least one letter
+ [""" + _LegalKeyChars + r"""]+? # Any word of at least one letter
) # End of group 'key'
- \s*=\s* # Equal Sign
- (?P<val> # Start of group 'val'
- "(?:[^\\"]|\\.)*" # Any doublequoted string
- | # or
+ ( # Optional group: there may not be a value.
+ \s*=\s* # Equal Sign
+ (?P<val> # Start of group 'val'
+ "(?:[^\\"]|\\.)*" # Any doublequoted string
+ | # or
\w{3},\s[\w\d\s-]{9,11}\s[\d:]{8}\sGMT # Special case for "expires" attr
- | # or
- [""" + _LegalValueChars + r"""]* # Any word or empty string
- ) # End of group 'val'
- \s*;? # Probably ending in a semi-colon
+ | # or
- """ + _LegalCharsPatt + r"""* # Any word or empty string
++ [""" + _LegalValueChars + r"""]* # Any word or empty string
+ ) # End of group 'val'
+ )? # End of optional value group
+ \s* # Any number of spaces.
+ (\s+|;|$) # Ending either at space, semicolon, or EOS.
""", re.ASCII) # May be removed if safe.
'repr': "<SimpleCookie: keebler='E=mc2'>",
'output': 'Set-Cookie: keebler=E=mc2'},
+ # Cookies with ':' character in their name. Though not mentioned in
+ # RFC, servers / browsers allow it.
+
+ {'data': 'key:term=value:term',
+ 'dict': {'key:term' : 'value:term'},
+ 'repr': "<SimpleCookie: key:term='value:term'>",
+ 'output': 'Set-Cookie: key:term=value:term'},
+
+ # issue22931 - Adding '[' and ']' as valid characters in cookie
+ # values as defined in RFC 6265
+ {
+ 'data': 'a=b; c=[; d=r; f=h',
+ 'dict': {'a':'b', 'c':'[', 'd':'r', 'f':'h'},
+ 'repr': "<SimpleCookie: a='b' c='[' d='r' f='h'>",
+ 'output': '\n'.join((
+ 'Set-Cookie: a=b',
+ 'Set-Cookie: c=[',
+ 'Set-Cookie: d=r',
+ 'Set-Cookie: f=h'
+ ))
+ }
]
for case in cases:
Library
-------
+ - Issue #22931: Allow '[' and ']' in cookie values.
+
+- Issue #24094: Fix possible crash in json.encode with poorly behaved dict
+ subclasses.
+
+- Issue #23367: Fix possible overflows in the unicodedata module.
+
+- Issue #23361: Fix possible overflow in Windows subprocess creation code.
+
+- Issue #23363: Fix possible overflow in itertools.permutations.
+
+- Issue #23364: Fix possible overflow in itertools.product.
+
+- Issue #23369: Fixed possible integer overflow in
+ _json.encode_basestring_ascii.
+
+- Issue #23366: Fixed possible integer overflow in itertools.combinations.
+
+- Issue #23365: Fixed possible integer overflow in
+ itertools.combinations_with_replacement.
-What's New in Python 3.2.6?
+C API
+-----
+
+- Issue #23998: PyImport_ReInitLock() now checks for lock allocation error
+
+
+What's New in Python 3.3.6?
===========================
*Release date: 11-Oct-2014*