diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-11 09:50:02 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-11 09:50:02 (GMT) |
commit | bd48d27944453ad83d3ce37b2c867fa0d59a1c15 (patch) | |
tree | f5585b5ce3995541ed6cce7bb4daef97f936be89 /Lib/http/cookies.py | |
parent | 352601ca00376aaf07d4399096f985d3d8ecb96f (diff) | |
download | cpython-bd48d27944453ad83d3ce37b2c867fa0d59a1c15.zip cpython-bd48d27944453ad83d3ce37b2c867fa0d59a1c15.tar.gz cpython-bd48d27944453ad83d3ce37b2c867fa0d59a1c15.tar.bz2 |
Issue #22493: Inline flags now should be used only at the start of the
regular expression. Deprecation warning is emitted if uses them in the
middle of the regular expression.
Diffstat (limited to 'Lib/http/cookies.py')
-rw-r--r-- | Lib/http/cookies.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py index f078da5..be3b080 100644 --- a/Lib/http/cookies.py +++ b/Lib/http/cookies.py @@ -458,7 +458,6 @@ class Morsel(dict): _LegalKeyChars = r"\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=" _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 |