diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-11-16 10:38:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-16 10:38:26 (GMT) |
commit | 05cb728d68a278d11466f9a6c8258d914135c96c (patch) | |
tree | da7fd67bdacf4239d820bcf40cad9f60cab9fb82 /Lib/email | |
parent | 3daaafb700df45716bb55f3a293f88773baf3463 (diff) | |
download | cpython-05cb728d68a278d11466f9a6c8258d914135c96c.zip cpython-05cb728d68a278d11466f9a6c8258d914135c96c.tar.gz cpython-05cb728d68a278d11466f9a6c8258d914135c96c.tar.bz2 |
bpo-30349: Raise FutureWarning for nested sets and set operations (#1553)
in regular expressions.
Diffstat (limited to 'Lib/email')
-rw-r--r-- | Lib/email/_header_value_parser.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py index 9b9697f..b4737c8 100644 --- a/Lib/email/_header_value_parser.py +++ b/Lib/email/_header_value_parser.py @@ -1354,15 +1354,14 @@ RouteComponentMarker = ValueTerminal('@', 'route-component-marker') _wsp_splitter = re.compile(r'([{}]+)'.format(''.join(WSP))).split _non_atom_end_matcher = re.compile(r"[^{}]+".format( - ''.join(ATOM_ENDS).replace('\\','\\\\').replace(']',r'\]'))).match + re.escape(''.join(ATOM_ENDS)))).match _non_printable_finder = re.compile(r"[\x00-\x20\x7F]").findall _non_token_end_matcher = re.compile(r"[^{}]+".format( - ''.join(TOKEN_ENDS).replace('\\','\\\\').replace(']',r'\]'))).match + re.escape(''.join(TOKEN_ENDS)))).match _non_attribute_end_matcher = re.compile(r"[^{}]+".format( - ''.join(ATTRIBUTE_ENDS).replace('\\','\\\\').replace(']',r'\]'))).match + re.escape(''.join(ATTRIBUTE_ENDS)))).match _non_extended_attribute_end_matcher = re.compile(r"[^{}]+".format( - ''.join(EXTENDED_ATTRIBUTE_ENDS).replace( - '\\','\\\\').replace(']',r'\]'))).match + re.escape(''.join(EXTENDED_ATTRIBUTE_ENDS)))).match def _validate_xtext(xtext): """If input token contains ASCII non-printables, register a defect.""" |