cpython/Doc/reference
Victor Stinner a60ddd31be
gh-98401: Invalid escape sequences emits SyntaxWarning (#99011)
A backslash-character pair that is not a valid escape sequence now
generates a SyntaxWarning, instead of DeprecationWarning.  For
example, re.compile("\d+\.\d+") now emits a SyntaxWarning ("\d" is an
invalid escape sequence), use raw strings for regular expression:
re.compile(r"\d+\.\d+"). In a future Python version, SyntaxError will
eventually be raised, instead of SyntaxWarning.

Octal escapes with value larger than 0o377 (ex: "\477"), deprecated
in Python 3.11, now produce a SyntaxWarning, instead of
DeprecationWarning. In a future Python version they will be
eventually a SyntaxError.

codecs.escape_decode() and codecs.unicode_escape_decode() are left
unchanged: they still emit DeprecationWarning.

* The parser only emits SyntaxWarning for Python 3.12 (feature
  version), and still emits DeprecationWarning on older Python
  versions.
* Fix SyntaxWarning by using raw strings in Tools/c-analyzer/ and
  wasm_build.py.
2022-11-03 17:53:25 +01:00
..
compound_stmts.rst Docs: Add 'as, match statement' to the index (#99001) 2022-11-02 19:15:00 -07:00
datamodel.rst docs: Change links to label refs (#98454) 2022-10-25 20:26:28 -07:00
executionmodel.rst gh-98227: executionmodel.rst: except* can also bind names (#98256) 2022-10-15 09:04:08 -07:00
expressions.rst Python documents state elsewhere that a comma is not an operator, so … (GH-98736) 2022-10-26 23:33:42 -07:00
grammar.rst bpo-42485: [Doc] Link to PEP 617 from full grammar specification (GH-23532) 2020-11-30 19:08:26 +00:00
import.rst gh-86298: Ensure that __loader__ and __spec__.loader agree in warnings.warn_explicit() (GH-97803) 2022-10-06 19:32:53 -07:00
index.rst Merge from 3.2: remove unneeded "Release" and "Date" markers from index pages. 2012-10-28 11:10:24 -07:00
introduction.rst gh-91838: Use HTTPS links in docs for resources which redirect to HTTPS (GH-95527) 2022-08-04 10:13:49 +03:00
lexical_analysis.rst gh-98401: Invalid escape sequences emits SyntaxWarning (#99011) 2022-11-03 17:53:25 +01:00
simple_stmts.rst Docs: Fix backtick errors found by sphinx-lint (#97998) 2022-10-06 18:01:30 -07:00
toplevel_components.rst bpo-41762: Fix usage of productionlist markup in the doc (GH-22281) 2020-09-18 09:10:15 +02:00