gh-130151: Fix reference leaks in `_hashlib.hmac_{new,digest}` (GH-130152)
* fix leak in `_hashlib.hmac_new`
* fix leak in `hmac_digest`
* fix exception type in `_hashlib.HMAC.copy`
(cherry picked from commit 071820113f)
* Clarify sys.getdefaultencoding() documentation
* Add missing documentation for PyUnicode_GetDefaultEncoding,
the C equivalent of sys.getdefaultencoding
(cherry picked from commit 9f25c1f012)
Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
* [3.12] Docs: Test presence of optional extensions with importlib (GH-130445)
(cherry picked from commit 3cc9e867eb)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Document the architectures supported by macOS universal SDK configuration flags,
and add details on wheel tag naming.
(cherry picked from commit 474c388740)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
gh-130159: Fix list indentation in collections.abc (GH-130165)
(cherry picked from commit 8e96adf453)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
gh-129363: Change regrtest sequential mode output (GH-129476)
First, write the test name without color. Then, write the test name
and the result with color. Each test is displayed twice.
(cherry picked from commit f1b81c408f)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
gh-129838: Don't redefine _Py_NO_SANITIZE_UNDEFINED (GH-129839)
Newer GCC versions accept both __attribute__((no_sanitize("undefined")))
and __attribute__((no_sanitize_undefined)) so check that the macro is
not already defined.
(cherry picked from commit 568db400ff)
Co-authored-by: Collin Funk <collin.funk1@gmail.com>
gh-46236: Document PyUnicode_RSplit, PyUnicode_Partition and PyUnicode_RPartition (GH-130191)
(cherry picked from commit 0f5b82169e)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
The `test_trace.test_coverage_ignore` test would fail if you had
`setuptools` installed, such as in `~/.local/lib/python3.xxx/site-packages/`.
Ignore everything in `sys.path` when running the test.
(cherry picked from commit 35925e9529)
gh-130250: use support.swap_attr() in test and don't assume we're beginning with a clean system state (GH-130342)
(cherry picked from commit 048ee2d5ec)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
gh-69001: Convert links to more usable buttons (GH-129591)
In Lib/idlelib/help_about.py, there are 2 links that are not underlined or colored, hence hard to tell that clicking works. All buttons might get converted to colored and underlined links in the future.
---------
(cherry picked from commit ed831b95a2)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Docs: Upgrade Sphinx to 8.2 (GH-130171)
(cherry picked from commit 736ad664e0)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
We had the definition of what makes a character "printable" documented in three places, giving two different definitions.
The definition in the comment on `_PyUnicode_IsPrintable` was inverted; correct that.
With that correction, the two definitions turn out to be equivalent -- but to confirm that, you have to go look up, or happen to know, that those are the only five "Other" categories and only three "Separator" categories in the Unicode character database. That makes it hard for the reader to tell whether they really are the same, or if there's some subtle difference in the intended semantics.
Fix that by cutting the C API docs' and the C comment's copies of the subtle details, in favor of referring to the Python-level docs. That ensures it's explicit that these are all meant to agree, and also lets us concentrate improvements to the wording in one place.
Speaking of which, borrow some ideas from the C comment, along with other tweaks, to hopefully add a bit more clarity to that one newly-centralized copy in the docs.
Also add a thorough test that the implementation agrees with this definition.
Co-authored-by: Greg Price <gnprice@gmail.com>
(cherry picked from commit 3402e133ef)
gh-118761: Revert "Improve import time of `subprocess` (GH-129427)" (GH-130201)
* Revert "gh-118761: Improve import time of `subprocess` (GH-129427)"
This reverts commit 49f24650e4.
Also known as f502c8f6a6 in 3.13 (PR GH-129447)
Also known as f65aa0d1bf in 3.12 (PR GH-129448)
This caused bugs in the `__del__` finalizer:
https://github.com/python/cpython/issues/118761#issuecomment-2661504264
---------
(cherry picked from commit ae30646089)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gh-130185: Fix unintentionally skipped tests in `test_functools` (GH-130186)
(cherry picked from commit 73d03005b0)
Co-authored-by: Tomas R <tomas.roun8@gmail.com>