gh-132983: Reduce the size of ``_zstdmodule.h`` (GH-133793)
(cherry picked from commit 1a548c0a50)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
When calling .close() the HTMLParser should flush all remaining content,
even when that content is in an unclosed script or style tag.
(cherry picked from commit 53383e90e4)
Co-authored-by: Waylan Limberg <waylan.limberg@icloud.com>
gh-132642: document how to render human-readable `timedelta` objects (GH-133825)
(cherry picked from commit efcc42ba70)
Co-authored-by: Kentaro Jay Takahashi <64148935+KentaroJay@users.noreply.github.com>
Tiny doc fix to double up backslashes in a Windows filesystem path (GH-133828)
(cherry picked from commit e7741dd773)
Co-authored-by: Tim Golden <mail@timgolden.me.uk>
GH-132983: PEP 7 and Argument Clinic changes for zstd (GH-133791)
(cherry picked from commit 1978904a2f)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
GH-132983: remove empty_bytes from _zstd module state (GH-133785)
(cherry picked from commit 98e2c3af47)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
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>