Commit graph

123737 commits

Author SHA1 Message Date
Miss Islington (bot)
0b90dc8e89
[3.13] gh-128636: Fix crash in PyREPL when os.environ is overwritten with an invalid value (GH-128653) (#129186)
gh-128636: Fix crash in PyREPL when `os.environ` is overwritten with an invalid value (GH-128653)
(cherry picked from commit ba9a4b6215)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-01-22 16:38:13 +00:00
Miss Islington (bot)
67971cd605
[3.13] gh-128770: fix ResourceWarning in test_pyrepl (GH-128906) (#129179) 2025-01-22 13:13:08 +00:00
Miss Islington (bot)
7f6e80a03e
[3.13] gh-128894: Fix TracebackException._format_syntax_error on custom SyntaxError metadata (GH-128946) (#129178) 2025-01-22 13:12:39 +00:00
Miss Islington (bot)
a379749217
[3.13] gh-129093: Fix f-string debug text sometimes getting cut off when expression contains ! (GH-129159) (#129163)
gh-129093: Fix f-string debug text sometimes getting cut off when expression contains `!` (GH-129159)
(cherry picked from commit 767cf70844)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-01-22 00:50:22 +00:00
Miss Islington (bot)
0ddcb61ffe
[3.13] gh-123024: Correctly prepare/restore around help and show-history commands (GH-124485) (#129155)
gh-123024: Correctly prepare/restore around help and show-history commands (GH-124485)
(cherry picked from commit 5a9afe2362)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Emily Morehouse <emily@cuttlesoft.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-01-21 22:15:57 +00:00
Miss Islington (bot)
3048dcd15a
[3.13] gh-125553: Fix backslash continuation in untokenize (GH-126010) (#129153)
gh-125553: Fix backslash continuation in `untokenize` (GH-126010)
(cherry picked from commit 7ad793e5db)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-01-21 21:04:55 +00:00
Miss Islington (bot)
0c7045378f
[3.13] gh-126332: Fix pyrepl crash for double ctrl-z in line overflow (GH-126650) (#129154)
gh-126332: Fix pyrepl crash for double ctrl-z in line overflow (GH-126650)

(cherry picked from commit d147e5e52c)

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2025-01-21 21:04:41 +00:00
Diego Russo
ffcef2d6f9
[3.13] Move to public Linux arm64 hosted runners (#129146) 2025-01-21 22:40:59 +02:00
Miss Islington (bot)
508ace6705
[3.13] gh-122845: fix parameter_list_starargs in function definition pseudo-grammar (GH-122847) (#129150)
gh-122845: fix parameter_list_starargs in function definition pseudo-grammar (GH-122847)

Thanks to Artur Chakhvadze for bugfix.
(cherry picked from commit 6105846390)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-01-21 20:12:43 +00:00
Hugo van Kemenade
383af395af
[3.13] gh-128595: Default to stdout isatty for colour detection instead of stderr (GH-128498) (#129057)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Fix `test__colorize` unexpected keyword argument 'file' on buildbots (#129070)
2025-01-21 18:14:24 +02:00
Miss Islington (bot)
972d95313c
[3.13] gh-118915: C API: Document compiler flag macros (GH-129028) (GH-129086)
(cherry picked from commit 6e02096e2f)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-01-21 11:47:55 +01:00
Miss Islington (bot)
8ab29d95a2
[3.13] Docs: fix typo in Doc/howto/mro.rst (GH-129095) (GH-129122)
(cherry picked from commit da310d209a)

Co-authored-by: smelnikov <13030121+smelnikov@users.noreply.github.com>
2025-01-21 10:40:31 +01:00
Miss Islington (bot)
f10f2a2e77
[3.13] GH-121970: Extract `changes` into a new extension (GH-129105) (#129109)
GH-121970: Extract ``changes`` into a new extension (GH-129105)
(cherry picked from commit e54ac3b69e)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-01-20 23:58:41 +00:00
Miss Islington (bot)
c5e1131cfb
[3.13] gh-111178: fix UBSan failures in Modules/_multiprocessing/semaphore.c (GH-129084) (#129100)
gh-111178: fix UBSan failures in `Modules/_multiprocessing/semaphore.c` (GH-129084)

fix UBSan failures for `SemLockObject`
(cherry picked from commit 5ed5572cac)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-01-20 21:05:52 +00:00
Miss Islington (bot)
2077082463
[3.13] doc: fix venv creating for the local Python using uv (GH-129094) (#129096)
Co-authored-by: Filipe Laíns 🇵🇸 <lains@riseup.net>
2025-01-20 21:13:12 +02:00
Miss Islington (bot)
03b2ecf41c
[3.13] GH-128131: Completely support random read access of uncompressed unencrypted files in ZipFile (GH-128143) (#129091)
GH-128131: Completely support random read access of uncompressed unencrypted files in ZipFile (GH-128143)
(cherry picked from commit dda02eb7be)

Co-authored-by: 5ec1cff <56485584+5ec1cff@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-01-20 18:28:52 +00:00
Miss Islington (bot)
a1c48a750c
[3.13] gh-128588: gh-128550: remove eager tasks optimization that missed and introduced incorrect cancellations (GH-129063) (#129089)
gh-128588: gh-128550: remove eager tasks optimization that missed and introduced incorrect cancellations (GH-129063)
(cherry picked from commit ed6934e71e)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-01-20 17:36:50 +00:00
Miss Islington (bot)
22e9faf08a
[3.13] Docs C API: Clarify what happens when null bytes are passed to PyUnicode_AsUTF8 (GH-127458) (#129080)
Docs C API: Clarify what happens when null bytes are passed to `PyUnicode_AsUTF8` (GH-127458)
(cherry picked from commit e792f4bc2e)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Stan U. <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-01-20 16:04:53 +00:00
Miss Islington (bot)
2f8eefe97a
[3.13] gh-129044: Update glossary entry for 'loader' to reflect current import system (GH-129073) (#129077)
gh-129044: Update glossary entry for 'loader' to reflect current import system (GH-129073)
(cherry picked from commit e1fa2fcc7c)

Co-authored-by: nikalinov <92603661+nikalinov@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-01-20 15:51:52 +00:00
Miss Islington (bot)
55d3d8165c
[3.13] gh-128978: Fix a NameError in sysconfig.expand_makefile_vars (GH-128979) (#129065)
gh-128978: Fix a `NameError` in `sysconfig.expand_makefile_vars` (GH-128979)

This fixes a regression introduced by 4a53a397c3.
(cherry picked from commit df66ff14b4)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-01-20 13:54:48 +00:00
Miss Islington (bot)
0351ed5049
[3.13] Fix a typo in syslog's error message (GH-129029) (#129049)
Fix a typo in `syslog`'s error message (GH-129029)
(cherry picked from commit 9b1c1817af)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-01-20 10:37:21 +00:00
Serhiy Storchaka
c6a566e47b
[3.13] gh-71339: Add additional assertion methods in test.support (GH-128707) (GH-128815)
Add a mix-in class ExtraAssertions containing the following methods:

* assertHasAttr() and assertNotHasAttr()
* assertIsSubclass() and assertNotIsSubclass()
* assertStartsWith() and assertNotStartsWith()
* assertEndsWith() and assertNotEndsWith()

(cherry picked from commit 06cad77a5b)
2025-01-20 11:19:00 +02:00
Miss Islington (bot)
59b919b082
[3.13] GH-125722: Use long options for Sphinx (GH-129039) (#129041)
GH-125722: Use long options for Sphinx (GH-129039)
(cherry picked from commit 4967fa6a9c)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-01-20 09:17:29 +02:00
Miss Islington (bot)
5fe7650552
[3.13] GH-125722: Increase minimum supported Sphinx to 8.1.3 (GH-128922) (#129037)
(cherry picked from commit d46b577ec0)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-01-20 00:52:00 +00:00
Miss Islington (bot)
080d17e945
[3.13] gh-129020: Remove ambiguous sentence from tokenize.untokenize docs (GH-129021) (#129035)
gh-129020: Remove ambiguous sentence from `tokenize.untokenize` docs (GH-129021)
(cherry picked from commit bca35f0e78)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-01-20 00:11:27 +00:00
Miss Islington (bot)
2120089547
[3.13] gh-80222: Fix email address header folding with long quoted-string (GH-122753) (#129007)
gh-80222: Fix email address header folding with long quoted-string (GH-122753)

Email generators using email.policy.default could incorrectly omit the
quote ('"') characters from a quoted-string during header refolding,
leading to invalid address headers and enabling header spoofing. This
change restores the quote characters on a bare-quoted-string as the
header is refolded, and escapes backslash and quote chars in the string.
(cherry picked from commit 5aaf416858)

Co-authored-by: Mike Edmunds <medmunds@gmail.com>
2025-01-19 16:06:28 -05:00
Victor Stinner
6b47499510
[3.13] gh-128679: Fix tracemalloc.stop() race conditions (#128897)
tracemalloc_alloc(), tracemalloc_realloc(), PyTraceMalloc_Track(),
PyTraceMalloc_Untrack() and _PyTraceMalloc_TraceRef() now check
tracemalloc_config.tracing after calling TABLES_LOCK().

_PyTraceMalloc_Stop() now protects more code with TABLES_LOCK(),
especially setting tracemalloc_config.tracing to 1.

Add a test using PyTraceMalloc_Track() to test tracemalloc.stop()
race condition.

Call _PyTraceMalloc_Init() at Python startup.
2025-01-18 23:39:07 +00:00
Tian Gao
ef9961840b
[3.13] gh-128991: Release the enter frame reference within bdb callba… (#129002)
[3.13] gh-128991: Release the enter frame reference within bdb callback (GH-128992)

* Release the enter frame reference within bdb callback

* 📜🤖 Added by blurb_it.

---------

(cherry picked from commit 61b35f74aa)
2025-01-18 17:21:23 -05:00
Miss Islington (bot)
03ee311e5a
[3.13] gh-128998: Fix indentation of numbered list and literal block (GH-128999) (#129000)
gh-128998: Fix indentation of numbered list and literal block (GH-128999)
(cherry picked from commit e8092e5cdc)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-01-18 20:58:20 +00:00
Peter Bierma
453eaa9ffc
[3.13] Pre-commit: Drop specific language version and bump hooks (GH-128801) (#128994)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-01-18 22:52:07 +02:00
Miss Islington (bot)
b7ddcc3efb
[3.13] gh-121542: Document trailing newline behavior in set_content() (GH-121543) (#128995)
gh-121542: Document trailing newline behavior in `set_content()` (GH-121543)
(cherry picked from commit fba475ae6f)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Yizheng Meng <dev@rapidcow.org>
2025-01-18 18:40:30 +00:00
Ed Nutting
fdac3629e9
[3.13] gh-127599: Fix _Py_RefcntAdd missing calls to _Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC (GH-127717) (#128713)
Previously, `_Py_RefcntAdd` hasn't called
`_Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC` which is incorrect.

Now it has been fixed.
(cherry picked from commit ab05beb8ce)
2025-01-18 19:00:46 +02:00
Victor Stinner
430ccbc009
[3.13] gh-111495: Add more tests on PyEval C APIs (#122789) (#128987)
* gh-111495: Add more tests on PyEval C APIs (#122789)

* Add Lib/test/test_capi/test_eval.py
* Add Modules/_testlimitedcapi/eval.c

(cherry picked from commit bf8b374639)

* gh-111495: Fix refleaks in test_capi.test_eval tests (#122851)

(cherry picked from commit b4a316087c)
2025-01-18 14:49:55 +00:00
Miss Islington (bot)
fff334e538
[3.13] gh-125997: suggest efficient alternatives for time.sleep(0) (GH-128752) (#128984)
gh-125997: suggest efficient alternatives for `time.sleep(0)` (GH-128752)
(cherry picked from commit f4afaa6f11)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-01-18 11:08:42 +00:00
Miss Islington (bot)
c75894a36b
[3.13] gh-128961: Fix exhausted array iterator crash in __setstate__() (GH-128962) (#128976)
(cherry picked from commit 4dade055f4)

Co-authored-by: Tomasz Pytel <tompytel@gmail.com>
2025-01-18 10:17:42 +00:00
Miss Islington (bot)
d8a442637b
[3.13] gh-128916: Do not set SO_REUSEPORT on non-AF_INET* sockets (GH-128933) (#128969)
gh-128916: Do not set `SO_REUSEPORT` on non-`AF_INET*` sockets (GH-128933)

* gh-128916: Do not set `SO_REUSEPORT` on non-`AF_INET*` sockets

Do not attempt to set ``SO_REUSEPORT`` on sockets of address familifies other
than ``AF_INET`` and ``AF_INET6``, as it is meaningless with these address
families, and the call with fail with Linux kernel 6.12.9 and newer.

* Apply suggestions from code review



---------
(cherry picked from commit 3829104ab4)

Co-authored-by: Michał Górny <mgorny@gentoo.org>
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2025-01-18 03:45:42 +00:00
Miss Islington (bot)
77e29c75da
[3.13] Fix definition of a generator iterator in glossary.rst (GH-128952) (#128967)
Fix definition of a `generator iterator` in `glossary.rst` (GH-128952)

Fix possible typo/grammar in glossary.rst

As discussed in https://discuss.python.org/t/typo-in-glossary-entry-for-generator-iterator/77163
(cherry picked from commit 8174770d31)

Co-authored-by: Daniel F Moisset <dfmoisset@gmail.com>
2025-01-18 00:52:10 +00:00
Victor Stinner
34ded1a1a1
[3.13] gh-128911: Add tests on the PyImport C API (#128915) (#128960)
gh-128911: Add tests on the PyImport C API (#128915)

* Add Modules/_testlimitedcapi/import.c
* Add Lib/test/test_capi/test_import.py
* Remove _testcapi.check_pyimport_addmodule(): tests already covered
  by newly added tests.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit d95ba9fa11)
2025-01-17 22:44:51 +01:00
Miss Islington (bot)
dc77f1914d
[3.13] gh-58956: Fix a frame refleak in bdb (GH-128190) (#128947)
* gh-58956: Fix a frame refleak in bdb (GH-128190)
(cherry picked from commit 767c89ba7c)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2025-01-17 12:49:15 -05:00
Miss Islington (bot)
9974e7185d
[3.13] gh-128017: Make a note that sys variables are read-only (GH-128887) (#128908)
Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్  రెడ్డి) <thatiparthysreenivas@gmail.com>
2025-01-17 18:04:00 +02:00
Miss Islington (bot)
d997ba45ed
[3.13] gh-58689: Fix os.kill() error handling on Windows (GH-128932) (#128937)
gh-58689: Fix os.kill() error handling on Windows (GH-128932)
(cherry picked from commit 939df0f9f6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-01-17 12:55:07 +00:00
Miss Islington (bot)
c927fd9d25
[3.13] gh-128816: Fix warnings in test_doctest (GH-128817) (GH-128870)
* Fix a deprecation warning for using importlib.resources.abc.ResourceReader.
* Fix an import warning when importing readline (if it has not yet been imported).
(cherry picked from commit 599be687ec)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2025-01-16 08:57:14 +00:00
Miss Islington (bot)
714b85136b
[3.13] gh-97850: Suggest TraversableResources as the alternative for ResourceLoader (GH-128601) (GH-128895)
gh-97850: Suggest `TraversableResources` as the alternative for `ResourceLoader` (GH-128601)

Suggest TraversableResources as the alternative for ResourceLoader.

Previously, ResourceReader was the suggested alternative, but it
is itself deprecated in favour of TraversableResources.
(cherry picked from commit 256d6d2131)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-01-15 20:53:17 +00:00
Miss Islington (bot)
639e0f36af
[3.13] gh-67206: Document that string.printable is not printable in the POSIX sense (GH-128820) (#128868)
gh-67206: Document that `string.printable` is not printable in the POSIX sense (GH-128820)
(cherry picked from commit d906bde250)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-01-15 14:27:27 +00:00
Miss Islington (bot)
132fd38f13
[3.13] gh-128874: Fix the documentation for blurb 2.0 (GH-128875) (#128877)
gh-128874: Fix the documentation for blurb 2.0 (GH-128875)
(cherry picked from commit 40a4d88a14)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-01-15 14:20:22 +00:00
Miss Islington (bot)
d2a8d57123
[3.13] gh-106320: Document replacement for removed C API (GH-128787) (#128837)
gh-106320: Document replacement for removed C API (GH-128787)
(cherry picked from commit 43ef9587ae)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-01-14 15:42:30 +00:00
Miss Islington (bot)
0998eb6275
[3.13] Fix a "doctest" block in Doc/library/turtle.rst (GH-128831) (#128835)
Fix a "doctest" block in `Doc/library/turtle.rst` (GH-128831)
(cherry picked from commit 1598e18a65)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-01-14 15:28:01 +00:00
Miss Islington (bot)
88b4b435fa
[3.13] gh-109959: Skip test_glob.test_selflink() flaky test (GH-128812) (#128821)
gh-109959: Skip test_glob.test_selflink() flaky test (GH-128812)
(cherry picked from commit 1153e66e20)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-01-14 10:55:33 +00:00
Peter Bierma
1ec36a62eb
[3.13] gh-128717: Stop-the-world when setting the recursion limit (GH-128741) (#128757)
[3.13] gh-128717: Stop-the-world when setting the recursion limit (GH-128741)
(cherry picked from commit f6c61bf2d7)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-01-14 13:33:52 +05:30
Miss Islington (bot)
f2a2809683
[3.13] gh-125997: Increase test coverage for time.sleep() (GH-128751) (#128796)
gh-125997: Increase test coverage for `time.sleep()` (GH-128751)

- Add tests for durations of invalid types.
- Add tests for `int` and `float` durations, including signed zeroes durations.
- Add tests for nonzero very small durations and durations close to the clock resolution.

---------
(cherry picked from commit b70a567575)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-01-13 17:23:27 +00:00