mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Issue #26302: merge from 3.5
This commit is contained in:
commit
b118870490
3 changed files with 10 additions and 1 deletions
|
@ -174,7 +174,7 @@ _Translator.update({
|
||||||
ord('\\'): '\\\\',
|
ord('\\'): '\\\\',
|
||||||
})
|
})
|
||||||
|
|
||||||
_is_legal_key = re.compile('[%s]+' % _LegalChars).fullmatch
|
_is_legal_key = re.compile('[%s]+' % re.escape(_LegalChars)).fullmatch
|
||||||
|
|
||||||
def _quote(str):
|
def _quote(str):
|
||||||
r"""Quote a string for use in a cookie header.
|
r"""Quote a string for use in a cookie header.
|
||||||
|
|
|
@ -210,6 +210,12 @@ class CookieTests(unittest.TestCase):
|
||||||
C1 = pickle.loads(pickle.dumps(C, protocol=proto))
|
C1 = pickle.loads(pickle.dumps(C, protocol=proto))
|
||||||
self.assertEqual(C1.output(), expected_output)
|
self.assertEqual(C1.output(), expected_output)
|
||||||
|
|
||||||
|
def test_illegal_chars(self):
|
||||||
|
rawdata = "a=b; c,d=e"
|
||||||
|
C = cookies.SimpleCookie()
|
||||||
|
with self.assertRaises(cookies.CookieError):
|
||||||
|
C.load(rawdata)
|
||||||
|
|
||||||
|
|
||||||
class MorselTests(unittest.TestCase):
|
class MorselTests(unittest.TestCase):
|
||||||
"""Tests for the Morsel object."""
|
"""Tests for the Morsel object."""
|
||||||
|
|
|
@ -10,6 +10,9 @@ Release date: tba
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #26302: Correct behavior to reject comma as a legal character for
|
||||||
|
cookie names.
|
||||||
|
|
||||||
- Issue #26136: Upgrade the warning when a generator raises StopIteration
|
- Issue #26136: Upgrade the warning when a generator raises StopIteration
|
||||||
from PendingDeprecationWarning to DeprecationWarning. Patch by Anish
|
from PendingDeprecationWarning to DeprecationWarning. Patch by Anish
|
||||||
Shah.
|
Shah.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue