This makes the test more reliable since there are not extra objects on the heap leftover
from other tests.
(cherry picked from commit 8598e57942)
Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
gh-133519: Add console to resources in libregrtest (GH-133520)
Add console to resources in libregrtest
(cherry picked from commit 4274b47156)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
gh-132983: Clean-ups for ``_zstd`` (GH-133670)
(cherry picked from commit c2a5d4b383)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
GH-132983: Remove subclassing support from zstd types (GH-133694)
For consistency with ``bz2``, ``lzma``, and ``zlib``.
(cherry picked from commit bd7c5859c6)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-133682: Fix inconsistent set ordering in annotationlib test (GH-133702)
(cherry picked from commit a2a0fa91c4)
Co-authored-by: Akshat Gupta <akshat.gupta24@gmail.com>
gh-133412: amend docs for the `inst` definition (GH-133708)
The `stack_effect` is incorrectly documented as being allowed to be optional.
(cherry picked from commit f77dac66e1)
Co-authored-by: Nybblista <170842536+nybblista@users.noreply.github.com>
According to the HTML5 spec, named character references in attribute values
should only be processed if they are not followed by an ASCII alphanumeric,
or an equals sign.
(cherry picked from commit 77b14a6d58)
https: //html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state
Co-authored-by: Sascha Ißbrücker <sascha.issbruecker@googlemail.com>
On Linux, use /proc/self/status for mem usage info. Using smaps_rollup is quite a lot slower and
we can get the similar info from /proc/self/status.
(cherry picked from commit 751db4e649)
Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
gh-103092: Support subinterpreters in ``_zstd`` (GH-133674)
(cherry picked from commit 6f6f48d289)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
The function `dict_set_fromkeys()` adds elements of a set to an existing
dictionary. The size of the expanded dictionary was estimated with
`PySet_GET_SIZE(iterable)`, which did not take into account the size of the
existing dictionary.
(cherry picked from commit 421ba589d0)
Co-authored-by: Angela Liss <59097311+angela-tarantula@users.noreply.github.com>
gh-132886: use relaxed atomics for `sock_fd` in gil builds in socket module (GH-133208)
(cherry picked from commit 2d82ab761a)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
This converts functions, code, str, bytes, bytearray, and memoryview objects to PyCodeObject,
and ensure that the object looks like a script. That means no args, no return, and no closure.
_PyCode_GetPureScriptXIData() takes it a step further and ensures there are no globals.
We also add _PyObject_SupportedAsScript() to the internal C-API.
(cherry picked from commit c81fa2b9cd, AKA gh-133480)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
gh-127833: Add links to token types to the lexical analysis intro (GH-131468)
(cherry picked from commit 45bb5ba61a)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Doc: Allow translating a code block in the tutorial (GH-131353)
(cherry picked from commit 3224b99872)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-133641: Doc: Add missing source link in ``concurrent.futures`` (GH-133642)
(cherry picked from commit 4fcd377563)
Co-authored-by: Jonas Obrist <ojiidotch@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-133403: Type `Tools/build/update_file.py` and check it with `mypy` (GH-133404)
(cherry picked from commit 50b52cba2d)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Zachary Ware <zach@python.org>
gh-133551: Skip annotationlib for now in ast roundtrip tests (GH-133634)
(cherry picked from commit 0a3ccb8dff)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
gh-133555: Allow regenerating the parser with Python < 3.14 (GH-133557)
(cherry picked from commit b48599b801)
Co-authored-by: Alex Prengère <2138730+alexprengere@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-127833: lexical analysis: Add backticks to BOM example (GH-132407)
(cherry picked from commit 0552ce0fb2)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
gh-133551: Support t-strings in annotationlib (GH-133553)
I don't know why you'd use t-strings in annotations, but now if you do,
the STRING format will do a great job of recovering the source code.
(cherry picked from commit 90f476e0f8)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This reverts commit 3c73cf5 (gh-133497), which itself reverted
the original commit d270bb5 (gh-133221).
We reverted the original change due to failing android tests.
The checks in _PyCode_CheckNoInternalState() were too strict,
so we've relaxed them.
gh-133558: Skip test_pdb tests on FreeBSD (GH-133566)
'\x08' is not interpreted as backspace on FreeBSD.
(cherry picked from commit 79b8a32fcb)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-133361: move the explanation of dict equal before its use (GH-133424)
Also move up the explanation of insertion order preservation. Both paragraphs seemed out of place down where they were.
---------
(cherry picked from commit 61ac88c06e)
Co-authored-by: Yongzi Li <1538321957@qq.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>