Commit graph

124051 commits

Author SHA1 Message Date
Miss Islington (bot)
3e45b1fece
[3.13] gh-117174: Adapt test_multiple_statements_fail_early to new REPL behavior (follow-up gh-131065) (GH-131836) (#131841)
gh-117174: Adapt `test_multiple_statements_fail_early` to new REPL behavior (follow-up gh-131065) (GH-131836)

Adapt test to new REPL behavior (follow-up gh-117174)
(cherry picked from commit a6cf8275f8)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2025-03-28 16:51:04 +00:00
Steve Dower
de8bc17c33
gh-131423: Update to OpenSSL 3.0.16. (GH-131839)
The bin tag is 3.0.16.1 because we rebuilt without uplink support to fix gh-131804.
This PR also prevents making calls that are now unsafe without uplink, and updates
the tests to property interpret these failures as unsupported.
2025-03-28 16:28:11 +00:00
Miss Islington (bot)
e460602705
[3.13] gh-117174: Adapt test_multiple_statements_fail_early now that we have always source (GH-131065) (#131850)
gh-117174: Adapt test_multiple_statements_fail_early now that we have always source (GH-131065)
(cherry picked from commit 4192ce17ba)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-03-28 15:39:13 +00:00
Miss Islington (bot)
924a6ceb81
[3.13] gh-127949: fix resource warnings in test_tasks.py (GH-128172) (#131805)
gh-127949: fix resource warnings in `test_tasks.py` (GH-128172)
(cherry picked from commit b66a4ad9fc)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2025-03-28 19:32:03 +05:30
Miss Islington (bot)
7f7fc549b4
[3.13] gh-118518: Minor improvements to perf docs (GH-130866) (#131059)
gh-118518: Minor improvements to perf docs (GH-130866)

Minor improvements to perf docs
(cherry picked from commit ecdf6b15b0)

Co-authored-by: stratakis <cstratak@redhat.com>
2025-03-28 11:42:58 +00:00
Miss Islington (bot)
8f6a9aa6ae
[3.13] gh-128231: Use runcode() return value for failing early (GH-129488) (#130513)
gh-128231: Use `runcode()` return value for failing early (GH-129488)
(cherry picked from commit 7ed3dc6392)

Co-authored-by: Bartosz Sławecki <bartoszpiotrslawecki@gmail.com>
2025-03-28 13:11:45 +02:00
Miss Islington (bot)
2ccb84a871
[3.13] gh-128446: Run Windows CI tests on each commit (GH-131702) (#131705)
gh-128446: Run Windows CI tests on each commit (GH-131702)
(cherry picked from commit 7d9442f0d5)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-03-28 13:08:18 +02:00
Miss Islington (bot)
5547c895e2
[3.13] gh-131818: Add imply -P in -I's help message (GH-131819) (#131822)
gh-131818: Add imply `-P` in `-I`'s help message (GH-131819)
(cherry picked from commit 8bd88e2827)

Co-authored-by: Hang <bebound@gmail.com>
2025-03-28 08:13:00 +00:00
Miss Islington (bot)
9118cf77ae
[3.13] Fix typo in importlib.metadata.rst (gh-131596) (#131630)
Fix typo in importlib.metadata.rst (gh-131596)
(cherry picked from commit 5fc889ffbf)

Co-authored-by: Zsolt Dollenstein <zsol.zsol@gmail.com>
2025-03-27 15:42:47 +02:00
Miss Islington (bot)
5c0be8ced6
[3.13] gh-131712: Build _suggestions extension on Windows (GH-131759) (#131790)
gh-131712: Build _suggestions extension on Windows (GH-131759)

Add a test checking that the '_suggestions' extension is available.
(cherry picked from commit 9ef9d687ff)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-03-27 09:19:46 +00:00
Miss Islington (bot)
b0f3876054
[3.13] gh-131762: Fixed dereferencing the pointer 'parser_token->metadata' with a NULL value (GH-131764) (#131774)
gh-131762: Fixed dereferencing the pointer 'parser_token->metadata' with a NULL value (GH-131764)
(cherry picked from commit 2c686a9ac2)

Co-authored-by: rialbat <47256826+rialbat@users.noreply.github.com>
2025-03-26 19:07:51 +00:00
Donghee Na
9d3f538471
[3.13] gh-131740: Update PyUnstable_GC_VisitObjects to traverse perm … (gh-131754)
* [3.13] gh-131740: Update PyUnstable_GC_VisitObjects to traverse perm gen (gh-131744)

(cherry picked from commit 7bb41aef4b)

* fix
2025-03-27 02:43:16 +09:00
Brian Schubert
5bcb476df1
[3.13] gh-131649: fix test_string_literals SyntaxWarning (GH-131650) (#131766)
(cherry picked from commit 2d83891dfd)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2025-03-26 17:31:59 +01:00
Miss Islington (bot)
28d02860c0
[3.13] gh-131741: Add documentation for Windows version detection change in platform (GH-131742) (#131767)
gh-131741: Add documentation for Windows version detection change in `platform` (GH-131742)

Document the behavior change between 3.11 & 3.12, where ``platform`` now correctly detects Windows 11 and Windows Server releases past Windows Server 2012.
(cherry picked from commit b9ca438daa)

Co-authored-by: Idan Noiman <idann@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: Wulian <1055917385@qq.com>
2025-03-26 14:56:44 +00:00
Miss Islington (bot)
b4fa4c2c3c
[3.13] document that sys._is_gil_enabled is CPython-specific (GH-131748) (#131760)
document that `sys._is_gil_enabled` is CPython-specific (GH-131748)
(cherry picked from commit ac12de2e6a)

Co-authored-by: Ralf Gommers <ralf.gommers@gmail.com>
2025-03-26 17:44:47 +05:30
Miss Islington (bot)
91ae3307ee
[3.13] gh-129900: Fix SystemExit return codes when the REPL is started from the command line (GH-129901) (#131734)
gh-129900: Fix `SystemExit` return codes when the REPL is started from the command line (GH-129901)
(cherry picked from commit 90b82f2b61)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-03-25 20:15:00 +00:00
Miss Islington (bot)
9c7ef0cc28
[3.13] gh-131719: add NULL pointer check to _PyMem_FreeDelayed (gh-131720) (gh-131722)
(cherry picked from commit 0a91456ad1)

Co-authored-by: Tomasz Pytel <tompytel@gmail.com>
2025-03-25 15:15:26 +00:00
Miss Islington (bot)
c22eef44d8
[3.13] gh-131677: Fix flaky test_lru_cache_threaded3 (gh-131679) (gh-131692)
The call to `with self.subTest(...)` was not thread-safe.
(cherry picked from commit a123245986)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-03-24 21:05:55 +00:00
Miss Islington (bot)
3492098418
[3.13] gh-131670: Fix crash in anext() when __anext__ is sync and raises (GH-131682) (#131686)
gh-131670: Fix crash in `anext()` when `__anext__` is sync and raises (GH-131682)
(cherry picked from commit 929afd1d6e)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-24 19:27:01 +00:00
Thomas Grainger
9f36dff788
[3.13] gh-131645: fix ResourceWarnings in test_asyncio.test_events (#131646) (#131661)
gh-131645: fix ResourceWarnings in `test_asyncio.test_events` (#131646)

(cherry picked from commit 71ce4acb25)
2025-03-24 13:18:57 +00:00
Petr Viktorin
478eb73103
[3.13] gh-130587: Add hand-written docs for non-OP tokens (GH-130588) (GH-131465)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2025-03-24 12:34:23 +00:00
Miss Islington (bot)
b3dccc0ce2
[3.13] gh-131045: [Enum] fix flag containment checks when using values (GH-131053) (#131167)
gh-131045: [Enum] fix flag containment checks when using values (GH-131053)

Check would fail if value would create a pseudo-member, but that member
had not yet been created.  We now attempt to create a pseudo-member for
a passed-in value first.
(cherry picked from commit 17d06aeb54)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2025-03-23 17:51:26 +01:00
Miss Islington (bot)
f577a43b8d
[3.13] gh-130283: update deprecated links and examples in urllib.request docs (GH-130284) (#131626)
gh-130283: update deprecated links and examples in `urllib.request` docs (GH-130284)
(cherry picked from commit fd459b1153)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-23 13:35:24 +00:00
Miss Islington (bot)
4af3d0e810
[3.13] gh-131418: remove unused legacy typedefs in {md5,sha1}module.c (GH-131420) (#131620)
gh-131418: remove unused legacy typedefs in `{md5,sha1}module.c` (GH-131420)

- Remove legacy typedefs `MD5_INT32` and `MD5_INT64` in `Modules/md5module.c`
- Remove legacy typedefs `SHA1_INT32` and `SHA1_INT64` in `Modules/sha1module.c`.

Those legacy typedefs were used to detect whether the host platform could
correctly implement MD5 and SHA-1, but this is no longer needed as we now
fallback to HACL* implementations.
(cherry picked from commit a9a399f0ec)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-23 12:21:57 +00:00
Miss Islington (bot)
5e3f93a8d7
[3.13] gh-121529: Document from_ parameter in _mboxMMDF public methods (GH-121530) (#131623)
gh-121529: Document `from_` parameter in `_mboxMMDF` public methods (GH-121530)
(cherry picked from commit 557d2d20d4)

Co-authored-by: Sebb <sebbASF@users.noreply.github.com>
2025-03-23 12:17:37 +00:00
Miss Islington (bot)
856bb54235
[3.13] gh-131357: Add a set of asserts to test.test_capi.test_bytearray (GH-131554) (#131601)
gh-131357: Add a set of asserts to test.test_capi.test_bytearray (GH-131554)

add a set of asserts to test.test_capi.test_bytearray

1. Assert empty bytearray object for PyByteArray_Check.
2. Assert empty bytearray object for PyByteArray_CheckExact.
3. Assert 0-size bytearray object for PyByteArray_Size.
4. Assert empty bytearray object for PyByteArray_AsString.
5. Assert concatenation of the bytearray object with itself for PyByteArray_Concat.
(cherry picked from commit f3bf304c27)

Co-authored-by: Nybblista <170842536+nybblista@users.noreply.github.com>
2025-03-23 10:44:47 +03:00
Miss Islington (bot)
eedaa4eefb
[3.13] gh-131457: Fix typo in BNF description of function signatures (GH-131460) (#131575)
gh-131457: Fix typo in BNF description of function signatures (GH-131460)
(cherry picked from commit 8b7d20d3a9)

Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్  రెడ్డి) <thatiparthysreenivas@gmail.com>
2025-03-22 08:00:54 +00:00
Miss Islington (bot)
94fbe97bbe
[3.13] gh-117657: Fix TSAN data race in _PyEval_SetTrace assertion (gh-131561) (#131564)
The `sys_tracing_threads` variable should be read inside `LOCK_SETUP()`.
(cherry picked from commit 0de5e0c544)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-03-21 18:48:40 +00:00
Miss Islington (bot)
55fb3a75d5
[3.13] gh-131507: Refactor screen and cursor position calculations (GH-131547) (GH-131557)
gh-131507: Refactor screen and cursor position calculations (GH-131547)

This is based off GH-131509.
(cherry picked from commit 4cc82ffa37)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-03-21 18:58:06 +01:00
Łukasz Langa
095c1263eb
[3.13] gh-131507: Clean up tests and type checking for _pyrepl (GH-131509) (GH-131546)
(cherry picked from commit 5d8e981c84)
2025-03-21 17:25:45 +01:00
Miss Islington (bot)
0a22407a23
[3.13] gh-131492, gh-131461: handle exceptions in GzipFile constructor while owning resources (GH-131462) (#131518)
(cherry picked from commit ce79274e9f)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-03-21 11:20:52 +01:00
Miss Islington (bot)
d256cfecfa
[3.13] gh-131441: Add a set of asserts to test.test_capi.test_list (GH-131442) (#131523)
gh-131441: Add a set of asserts to test.test_capi.test_list (GH-131442)
(cherry picked from commit 2433cc79d7)

Co-authored-by: Nybblista <170842536+nybblista@users.noreply.github.com>
2025-03-20 19:25:16 +00:00
Miss Islington (bot)
646b453a15
[3.13] gh-88887: Cleanup multiprocessing.resource_tracker.ResourceTracker upon deletion (GH-130429) (#131516)
gh-88887: Cleanup `multiprocessing.resource_tracker.ResourceTracker` upon deletion (GH-130429)
(cherry picked from commit f53e7de6a8)

Co-authored-by: luccabb <32229669+luccabb@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-03-20 17:08:58 +00:00
Adam Turner
26b04a16ee
[3.13] GH-121970: Extract pydoc_topics into a new extension (GH-131256) (#131511)
(cherry picked from commit c1a02f9101)
2025-03-20 15:34:10 +00:00
Miss Islington (bot)
2b5feb1f9e
[3.13] Docs: Fix documentation for "PyTypeObject Definition" (GH-130936) (GH-131458)
The structure definition for `PyTypeObject` is in `Include/cpython/object.h`,
not in `Include/object.h`.
(cherry picked from commit a0478c9f0c)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-03-20 13:41:06 +01:00
Miss Islington (bot)
69db2ebfce
[3.13] gh-131117: Update tp_finalize example to use PyErr_GetRaisedException (GH-131118) (#131476)
gh-131117: Update tp_finalize example to use PyErr_GetRaisedException (GH-131118)

The tp_finalize C API doc used PyErr_Fetch() and PyErr_Restore() in
its example code. That API was deprecated in 3.12.

Update to point to the suggested replacement function
PyErr_GetRaisedException() which has a sample usage.
(cherry picked from commit a4832f6b9a)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2025-03-19 17:34:15 +00:00
Miss Islington (bot)
12227223d1
[3.13] gh-131263: Skip test_timerfd_negative on NetBSD to prevent system freeze (GH-131431) (#131451)
gh-131263: Skip test_timerfd_negative on NetBSD to prevent system freeze (GH-131431)
(cherry picked from commit 8ad4646c67)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2025-03-19 12:52:11 +01:00
Miss Islington (bot)
49efc411fa
[3.13] gh-118915: Document PY_MONITORING_IS_INSTRUMENTED_EVENT (GH-128026) (GH-131424)
(cherry picked from commit f819900245)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-03-19 11:37:34 +01:00
Miss Islington (bot)
b39e67396f
[3.13] gh-131417: Mention asyncio Future and Task in docs for generic classes list (GH-131422) (#131445)
gh-131417: Mention asyncio Future and Task in docs for generic classes list (GH-131422)

Mention asyncio Future and Task in docs for generic classes list
(cherry picked from commit 61b4b2c57c)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2025-03-19 10:23:48 +01:00
Miss Islington (bot)
5d73970687
[3.13] Docs: fix shell command formatting (GH-131310) (#131443)
Docs: fix shell command formatting (GH-131310)

replace "zypper in" with "zypper install" to avoid incorrect highlighting
(cherry picked from commit 267c06d6a8)

Co-authored-by: partev <petrosyan@gmail.com>
2025-03-19 07:50:53 +00:00
Miss Islington (bot)
ff286a3d94
[3.13] gh-124666: Improve thread cleanup in test_android (GH-131427) (#131433)
Ensures that failures in test setup don't result in dangling threads.
(cherry picked from commit 01b5abbc53)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-03-19 08:30:59 +08:00
Miss Islington (bot)
31767e6100
[3.13] gh-121284: Fix email address header folding with parsed encoded-word (GH-122754) (#131403)
gh-121284: Fix email address header folding with parsed encoded-word (GH-122754)

Email generators using email.policy.default may convert an RFC 2047
encoded-word to unencoded form during header refolding. In a structured
header, this could allow 'specials' chars outside a quoted-string,
leading to invalid address headers and enabling spoofing. This change
ensures a parsed encoded-word that contains specials is kept as an
encoded-word while the header is refolded.

[Better fix from @bitdancer.]

---------
(cherry picked from commit 295b53df2a)

Co-authored-by: Mike Edmunds <medmunds@gmail.com>
Co-authored-by: R David Murray <rdmurray@bitdance.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-03-18 15:34:00 -04:00
Bénédikt Tran
85c20374c0
[3.13] gh-131277: allow EnvironmentVarGuard to unset more than one environment variable at once (GH-131280) (#131409)
(cherry picked from commit 3185e3115c)

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-03-18 13:48:59 +01:00
Miss Islington (bot)
25ae2045a8
[3.13] gh-116666: Add "token" glossary term (GH-130888) (GH-131367)
gh-116666: Add "token" glossary term (GH-130888)

Add glossary entry for `token`, and link to it.
Avoid talking about tokens in the SyntaxError intro (errors.rst); at this point
tokenization is too much of a technical detail. (Even to an advanced reader,
the fact that a *single* token is highlighted isn't too relevant. Also, we don't
need to guarantee that it's a single token.)
(cherry picked from commit 30d5205849)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-03-18 12:51:02 +01:00
Miss Islington (bot)
e425b075fe
[3.13] gh-131002: clarify how to enforce sqlite3 column types for generated fields (GH-131006) (#131385)
(cherry picked from commit f48887fb97)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2025-03-18 12:09:41 +01:00
Miss Islington (bot)
f297dabbe0
[3.13] gh-130132: properly free resources in urrlib.urlopen examples (GH-130280) (#131394)
gh-130132: properly free resources in `urrlib.urlopen` examples (GH-130280)
(cherry picked from commit 77d2fd4413)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-18 09:33:19 +00:00
Miss Islington (bot)
98195b2108
[3.13] gh-131094: Refine math.isclose docs (GH-131139) (#131392)
gh-131094: Refine `math.isclose` docs (GH-131139)
(cherry picked from commit 3f50f96586)

Co-authored-by: Guy Jacoby <49398101+guyjacoby@users.noreply.github.com>
2025-03-18 09:21:13 +00:00
Bénédikt Tran
170abd2199
[3.13] gh-127667: refactor and improve _hashopenssl.c error branches (#131145) (#131347)
gh-127667: refactor and improve `_hashopenssl.c` error branches (#131145)

Refactor `_setException()` into different helpers that can be used separately:

- set_ssl_exception_from_errcode(): set an exception from an explicit SSL error code.
- raise_ssl_error(): set an exception from the last SSL error code or use a user-defined message.
- notify_ssl_error_occurred(): same as raise_ssl_error() but with a generic default message.

(cherry-picked from commit ac50ece6ce).
2025-03-18 10:16:49 +01:00
Malcolm Smith
e8e6e30054
[3.13] gh-118201: Simplify conv_confname (#126089) (#131375)
gh-118201: Simplify conv_confname (#126089)

(cherry picked from commit c5c9286804)
2025-03-18 12:53:10 +08:00
Miss Islington (bot)
9a43485830
[3.13] gh-131325: fix sendfile fallback implementation to drain data after writing to transport (GH-131376) (#131377)
gh-131325: fix sendfile fallback implementation to drain data after writing to transport (GH-131376)
(cherry picked from commit 94f4d87aeb)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-03-17 19:46:30 +00:00