Ensure colorize tests will run on dumb terminals (or environment with TERM=dumb set)
(cherry picked from commit 1b070060c0)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
[3.13] gh-128396: Fix a crash when inline comprehension has the same local variable as the outside scope (GH-130235)
(cherry picked from commit ccf17323c2)
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.
Author: Greg Price <gnprice@gmail.com>
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>
gh-130169: Fix broken list markup in `Doc/c-api/function.rst` (GH-130174)
(cherry picked from commit 9837c2a214)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Correct handling of symlinks during iOS testbed framework installation.
(cherry picked from commit 625470a7d2)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
gh-129693: Suppress `SyntaxWarning` in test_fstring (GH-129830)
Suppress SyntaxWarning in test_fstring
(cherry picked from commit 2dd018848c)
Co-authored-by: Tomas R <tomas.roun8@gmail.com>
We should use a relaxed atomic load in the free threading build in
`PyType_Modified()` because that's called without the type lock held.
It's not necessary to use atomics in `type_modified_unlocked()`.
We should also use `FT_ATOMIC_STORE_UINT_RELAXED()` instead of the
`UINT32` variant because `tp_version_tag` is declared as `unsigned int`.
(cherry picked from commit 57f45ee2d8)
gh-129983: fix data race in compile_template in sre.c (#130015)
(cherry picked from commit 3cf68cdd3e)
Co-authored-by: Tomasz Pytel <tompytel@gmail.com>
---------
(cherry picked from commit 555ee43d92)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
The call to `PySequence_List()` could temporarily unlock and relock the
set, allowing the items to be cleared and return the incorrect
notation `{}` for a empty set (it should be `set()`).
(cherry picked from commit a7427f2db9)
Co-authored-by: T. Wouters <thomas@python.org>
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
gh-97850: Update the deprecation warning of `importlib.abc.Loader.load_module` (GH-129855)
(cherry picked from commit aa81a6f6e4)
Co-authored-by: Tomas R <tomas.roun8@gmail.com>
gh-126554: correct detection of `gcc` for `TestNullDlsym.test_null_dlsym` (GH-129872)
In case gcc is not available, the test will fail with FileNotFoundError.
So catch the exception to skip the test correctly.
(cherry picked from commit 978211c8a8)
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Co-authored-by: Peter Marko <peter.marko@siemens.com>
gh-129892: Doc: Remove unnecessary role directive in graphlib.py (GH-129896)
Change `:exec:ValueError` to `ValueError` in `TopologicalSorter.done()` docstring
(cherry picked from commit c53730171f)
Co-authored-by: Nikola Savic <76233425+nikolasavic3@users.noreply.github.com>