From 6543912c90ffa579dc4c01e811f9609cf92197d3 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 19 Oct 2018 17:42:06 +0300 Subject: bpo-32912: Replace a DeprecationWarning with a SyntaxWarning (GH-9652) for invalid escape sequences in string and bytes literals. --- Doc/reference/lexical_analysis.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Doc/reference') diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst index 84e8c78383..e1d88eff95 100644 --- a/Doc/reference/lexical_analysis.rst +++ b/Doc/reference/lexical_analysis.rst @@ -559,8 +559,11 @@ escape sequences only recognized in string literals fall into the category of unrecognized escapes for bytes literals. .. versionchanged:: 3.6 - Unrecognized escape sequences produce a DeprecationWarning. In - some future version of Python they will be a SyntaxError. + Unrecognized escape sequences produce a :exc:`DeprecationWarning`. + + .. versionchanged:: 3.8 + Unrecognized escape sequences produce a :exc:`SyntaxWarning`. In + some future version of Python they will be a :exc:`SyntaxError`. Even in a raw literal, quotes can be escaped with a backslash, but the backslash remains in the result; for example, ``r"\""`` is a valid string -- cgit v1.2.1