* bpo-46339: Fix crash in the parser when computing error text for multi-line f-strings (GH-30529)
Automerge-Triggered-By: GH:pablogsal
(cherry picked from commit cedec19be8)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* Fix interactive mode
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Other descriptions in the same file also use 'bytestring' to refer to bytes objects
(cherry picked from commit 4b99803b86)
Co-authored-by: Florian Bruhin <me@the-compiler.org>
The docstrings for MappingProxyType's keys(), values(), and items()
methods were never updated to reflect the changes that Python 3 brought
to these APIs, namely returning views rather than lists.
(cherry picked from commit 2d10fa9bc4)
Co-authored-by: Joshua Bronson <jabronson@gmail.com>
A small change to the documentation of datetime module , in the format codes section of stftime and strptime. Changed the description of format code '%W' from 'as a decimal number' to 'a zero padded decimal number' so it's in line with the example having leading zeros. Similar to the format code '%U' above.
Automerge-Triggered-By: GH:pganssle
(cherry picked from commit d45cd2d207)
Co-authored-by: Evan <binary-signal@users.noreply.github.com>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 0a49148e87)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Automerge-Triggered-By: GH:Fidget-Spinner
The documentation on ``GenericAlias`` objects implies at multiple points that
only container classes can define ``__class_getitem__``. This is misleading.
This PR proposes a rewrite of the documentation to clarify that non-container
classes can define ``__class_getitem__``, and to clarify what it means when a
non-container class is parameterized.
See also: initial discussion of issues with this piece of documentation in
GH-29308, and previous BPO issue [42280]().
Also improved references in glossary and typing docs. Fixed some links.
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 0eae9a2a2d)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Automerge-Triggered-By: GH:Fidget-Spinner
* bpo-46402: Promote SQLite URI tricks in `sqlite3` docs (GH-30660)
Provide some examples of URI parameters in sqlite connect().
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
(cherry picked from commit bdf2ab1887)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* Update suspicious rules
This addresses [bpo-45554]() by expanding the `exitcode` documentation to also describe what `exitcode` will be in cases of normal termination, `sys.exit()` called, and on uncaught exceptions.
Automerge-Triggered-By: GH:pitrou
(cherry picked from commit 3852269b91)
Co-authored-by: John Marshall <jmarshall@hey.com>
Skip test_builtin PTY tests on non-ASCII characters if the readline
module is loaded. The readline module changes input() behavior, but
test_builtin is not intented to test the readline module.
When the readline module is loaded, PyOS_Readline() uses the readline
implementation. In some cases, the Python readline callback
rlhandler() is called by readline with a string without non-ASCII
characters.
(cherry picked from commit ad6e640f91)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Robert Collins <robertc@robertcollins.net>
(cherry picked from commit 73140de97c)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Test if tracemalloc_copy_traces() failed to allocated memory in
tracemalloc_copy_domain().
(cherry picked from commit 7c770d3350)
Co-authored-by: Victor Stinner <vstinner@python.org>
Py_EndInterpreter() now explicitly untracks all objects currently
tracked by the GC. Previously, if an object was used later by another
interpreter, calling PyObject_GC_UnTrack() on the object crashed if
the previous or the next object of the PyGC_Head structure became a
dangling pointer.
(cherry picked from commit 1a4d1c1c9b)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Ian Kelling <ian@iankelling.org>
(cherry picked from commit 6d07a9fb7c)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
If init flag is set, exit successfully immediately.
If not, only set the flag after successful initialization.
(cherry picked from commit b127e70a8a)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
This reverts commit ea251806b8.
Keep "assert(interned == NULL);" in _PyUnicode_Fini(), but only for
the main interpreter.
Keep _PyUnicode_ClearInterned() changes avoiding the creation of a
temporary Python list object.
Leave the PyInterpreterState structure unchanged to keep the ABI
backward compatibility with Python 3.10.0: rename the "interned"
member to "unused_interned".
(cherry picked from commit 35d6540c90)
(cherry picked from commit 3e43fac250)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>