summaryrefslogtreecommitdiff
path: root/Lib/http/cookies.py
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2017-01-29 10:09:43 +0000
committerMartin Panter <vadmium+py@gmail.com>2017-01-29 10:09:43 +0000
commit6d1d733828b49eb03d45da81c6b8c6b849fbc5df (patch)
treeb0b120d6c527fb8cf6e4a0f175556611673ad780 /Lib/http/cookies.py
parent357e8cdc9b1c5a99be9ade2b1070c38d50ddadc6 (diff)
parent23282e54fdd766945930006ab606641a2db37a4c (diff)
downloadcpython-6d1d733828b49eb03d45da81c6b8c6b849fbc5df.tar.gz
Issues #29349: Merge Py 2 fix 3.5
Diffstat (limited to 'Lib/http/cookies.py')
-rw-r--r--Lib/http/cookies.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py
index a73fe387f8..be3b080aa3 100644
--- a/Lib/http/cookies.py
+++ b/Lib/http/cookies.py
@@ -456,9 +456,8 @@ class Morsel(dict):
#
_LegalKeyChars = r"\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\="
-_LegalValueChars = _LegalKeyChars + '\[\]'
+_LegalValueChars = _LegalKeyChars + r'\[\]'
_CookiePattern = re.compile(r"""
- (?x) # This is a verbose pattern
\s* # Optional whitespace at start of cookie
(?P<key> # Start of group 'key'
[""" + _LegalKeyChars + r"""]+? # Any word of at least one letter
@@ -475,7 +474,7 @@ _CookiePattern = re.compile(r"""
)? # 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.
+ """, re.ASCII | re.VERBOSE) # re.ASCII may be removed if safe.
# At long last, here is the cookie class. Using this class is almost just like