]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
11 months ago[3.13] Fix Unicode encode_wstr_utf8() (#127420) (#127505)
Bénédikt Tran [Mon, 2 Dec 2024 12:24:03 +0000 (13:24 +0100)] 
[3.13] Fix Unicode encode_wstr_utf8() (#127420) (#127505)

Fix Unicode encode_wstr_utf8() (#127420)

Raise RuntimeError instead of RuntimeWarning.

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] gh-127443: Fix some entries in `Doc/data/refcounts.dat` (GH-127451) (#127496)
Miss Islington (bot) [Mon, 2 Dec 2024 08:28:15 +0000 (09:28 +0100)] 
[3.13] gh-127443: Fix some entries in `Doc/data/refcounts.dat` (GH-127451) (#127496)

gh-127443: Fix some entries in `Doc/data/refcounts.dat` (GH-127451)

Fix incorrect entries in `Doc/data/refcounts.dat`
(cherry picked from commit 1f8267b85dda655282922ba20df90d0ac6bea634)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.13] gh-127321: Avoid stopping at an opcode without an associated line number for...
Tian Gao [Sun, 1 Dec 2024 22:58:08 +0000 (14:58 -0800)] 
[3.13] gh-127321: Avoid stopping at an opcode without an associated line number for breakpoint() (GH-127457) (#127487)

(cherry picked from commit 1bc4f076d193ad157bdc69a1d62685a15f95113f)

11 months ago[3.13] gh-127356: Fix prepend doctrees directory for gettext target (GH-127357) ...
Miss Islington (bot) [Sun, 1 Dec 2024 09:21:34 +0000 (10:21 +0100)] 
[3.13] gh-127356: Fix prepend doctrees directory for gettext target (GH-127357) (#127470)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
11 months ago[3.13] Docs: Fix incorrect indents in `c-api/type.rst` (GH-127449) (#127460)
Yuki Kobayashi [Sun, 1 Dec 2024 08:50:51 +0000 (17:50 +0900)] 
[3.13] Docs: Fix incorrect indents in `c-api/type.rst` (GH-127449) (#127460)

(cherry picked from commit 33ce8dcf791721fea563715f681dc1593a35b83b)

11 months ago[3.13] Add the missing `f` on an f-string error message in multiprocessing. (GH-12746...
Miss Islington (bot) [Sun, 1 Dec 2024 07:50:01 +0000 (08:50 +0100)] 
[3.13] Add the missing `f` on an f-string error message in multiprocessing. (GH-127462) (#127464)

Add the missing `f` on an f-string error message in multiprocessing. (GH-127462)
(cherry picked from commit 11c01092d5fa8f02c867a7f1f3c135ce63db4838)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
11 months ago[3.13] gh-127165: Disallow embedded NULL characters in `_interpreters` (GH-127199...
Miss Islington (bot) [Sun, 1 Dec 2024 06:55:55 +0000 (07:55 +0100)] 
[3.13] gh-127165: Disallow embedded NULL characters in `_interpreters` (GH-127199) (#127463)

gh-127165: Disallow embedded NULL characters in `_interpreters` (GH-127199)
(cherry picked from commit 46bfd26fb294a8769ef6d0c056ee6c9df022a037)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
11 months ago[3.13] gh-127190: Fix local_setattro() error handling (GH-127366) (#127367)
Miss Islington (bot) [Sun, 1 Dec 2024 06:48:04 +0000 (07:48 +0100)] 
[3.13] gh-127190: Fix local_setattro() error handling (GH-127366) (#127367)

gh-127190: Fix local_setattro() error handling (GH-127366)

Don't make the assumption that the 'name' argument is a string. Use
repr() to format the 'name' argument instead.
(cherry picked from commit 20657fbdb14d50ca4ec115da0cbef155871d8d33)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] gh-127341: Argument Clinic: fix compiler warnings for getters with docstrings...
Peter Bierma [Sat, 30 Nov 2024 22:25:51 +0000 (17:25 -0500)] 
[3.13] gh-127341: Argument Clinic: fix compiler warnings for getters with docstrings (GH-127310) (#127431)

(cherry picked from commit 99490913a08adcf2fe5e69b82772a829ec462275)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
11 months ago[3.13] summarize: Fix typo in stats (GH-127450) (#127454)
Miss Islington (bot) [Sat, 30 Nov 2024 16:32:13 +0000 (17:32 +0100)] 
[3.13] summarize: Fix typo in stats (GH-127450) (#127454)

Co-authored-by: alm <alonme@users.noreply.github.com>
11 months ago[3.13] gh-109746: Fix race condition in test_start_new_thread_failed (GH-127299)...
Miss Islington (bot) [Sat, 30 Nov 2024 09:19:13 +0000 (10:19 +0100)] 
[3.13] gh-109746: Fix race condition in test_start_new_thread_failed (GH-127299) (GH-127323)

(cherry picked from commit 83926d3b4c7847394b5e2531e9566d7fc9fbea0f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.13] gh-124008: Fix calculation of the number of written bytes for the Windows...
Miss Islington (bot) [Sat, 30 Nov 2024 09:16:45 +0000 (10:16 +0100)] 
[3.13] gh-124008: Fix calculation of the number of written bytes for the Windows console (GH-124059) (GH-127325)

Since MultiByteToWideChar()/WideCharToMultiByte() is not reversible if
the data contains invalid UTF-8 sequences, use binary search to
calculate the number of written bytes from the number of written
characters.

Also fix writing incomplete UTF-8 sequences.

Also fix handling of memory allocation failures.
(cherry picked from commit 3cf83d91a5baf3600dd60f7aaaf4fb6d73c4b8a9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.13] gh-123967: Fix faulthandler for trampoline frames (GH-127329) (#127362)
Miss Islington (bot) [Sat, 30 Nov 2024 09:14:29 +0000 (10:14 +0100)] 
[3.13] gh-123967: Fix faulthandler for trampoline frames (GH-127329) (#127362)

gh-123967: Fix faulthandler for trampoline frames (GH-127329)

If the top-most frame is a trampoline frame, skip it.
(cherry picked from commit 58e334e1431b2ed6b70ee42501ea73e08084e769)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] gh-127217: Fix pathname2url() for paths starting with multiple slashes on...
Miss Islington (bot) [Sat, 30 Nov 2024 09:11:24 +0000 (10:11 +0100)] 
[3.13] gh-127217: Fix pathname2url() for paths starting with multiple slashes on Posix (GH-127218) (GH-127230)

(cherry picked from commit 97b2ceaaaf88a73a45254912a0e972412879ccbf)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.13] gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304) (#127390)
Miss Islington (bot) [Sat, 30 Nov 2024 08:13:13 +0000 (09:13 +0100)] 
[3.13] gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304) (#127390)

gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304)

---------

(cherry picked from commit dd3a87d2a8f8750978359a99de2c5cb2168351d1)

Co-authored-by: Илья Любавский <100635212+lubaskinc0de@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.13] gh-127316: fix incorrect assertion in setting `__class__` in free-threading...
Miss Islington (bot) [Fri, 29 Nov 2024 16:36:44 +0000 (17:36 +0100)] 
[3.13] gh-127316: fix incorrect assertion in setting `__class__` in free-threading (GH-127399) (#127422)

gh-127316: fix incorrect assertion in setting `__class__` in free-threading (GH-127399)
(cherry picked from commit 45c5cba318a19dda3ee6f9fc84781cc7a2fbde80)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
11 months ago[3.13] Link to correct class methods in asyncio primitives docs (GH-127270) (#127423)
Miss Islington (bot) [Fri, 29 Nov 2024 16:26:42 +0000 (17:26 +0100)] 
[3.13] Link to correct class methods in asyncio primitives docs (GH-127270) (#127423)

Link to correct class methods in asyncio primitives docs (GH-127270)
(cherry picked from commit 15d6506d175780bb29e5fcde654e3860408aa93e)

Co-authored-by: Ollanta Cuba Gyllensten <ollantaster@gmail.com>
11 months ago[3.13] gh-127208: Reject null character in _imp.create_dynamic() (GH-127400) (#127418)
Miss Islington (bot) [Fri, 29 Nov 2024 15:45:21 +0000 (16:45 +0100)] 
[3.13] gh-127208: Reject null character in _imp.create_dynamic() (GH-127400) (#127418)

gh-127208: Reject null character in _imp.create_dynamic() (GH-127400)

_imp.create_dynamic() now rejects embedded null characters in the
path and in the module name.
(cherry picked from commit b14fdadc6c620875a20b7ccc3c9b069e85d8557a)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] gh-124873: Skip timerfd tests on Android (GH-127279) (#127290)
Miss Islington (bot) [Fri, 29 Nov 2024 11:46:47 +0000 (12:46 +0100)] 
[3.13] gh-124873: Skip timerfd tests on Android (GH-127279) (#127290)

gh-124873: Skip timerfd tests on Android (GH-127279)

* Revert "[3.13] gh-124873: Tolerate 100 ms in TimerfdTests on Android (GH-127101) (GH-127105)"

This reverts commit c09366b1fed2289530581505834b2b262120a7c7.

* Skip timerfd tests on Android.

(cherry picked from commit 4ca2c82862e3810a7d68799df2bb5198a9afb219)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (GH-127358)...
Miss Islington (bot) [Fri, 29 Nov 2024 11:01:59 +0000 (12:01 +0100)] 
[3.13] gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (GH-127358) (#127401)

gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (GH-127358)

Replace the sleep(2) with a task which is blocked forever.
(cherry picked from commit bfabf96b50b7d6a9c15b298a86ba3633b05a1fd7)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] fix param type in PyObject_HasAttrWithError (docs) (GH-127403) (#127404)
Miss Islington (bot) [Fri, 29 Nov 2024 10:59:13 +0000 (11:59 +0100)] 
[3.13] fix param type in PyObject_HasAttrWithError (docs) (GH-127403) (#127404)

fix param type in PyObject_HasAttrWithError (docs) (GH-127403)
(cherry picked from commit 3afb639f39e89888194d8e74cc498c8da3a58d8e)

Co-authored-by: biggus-developerus <74741815+biggus-developerus@users.noreply.github.com>
11 months ago[3.13] gh-126881: fix finalization of dtoa state (GH-126904) (#127395)
Miss Islington (bot) [Fri, 29 Nov 2024 10:52:21 +0000 (11:52 +0100)] 
[3.13] gh-126881: fix finalization of dtoa state (GH-126904) (#127395)

gh-126881: fix finalization of dtoa state (GH-126904)
(cherry picked from commit 762c603a866146afc7db2591fb49605e0858e9b1)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
11 months ago[3.13] gh-127359: Pin Tcl/Tk to 8 (8.6) for testing macOS (#127365) (#127393)
Hugo van Kemenade [Fri, 29 Nov 2024 09:59:57 +0000 (11:59 +0200)] 
[3.13] gh-127359: Pin Tcl/Tk to 8 (8.6) for testing macOS (#127365) (#127393)

11 months ago[3.13] Fix indentation for contextlib.asynccontextmanager docs (GH-127333) (#127334)
Miss Islington (bot) [Wed, 27 Nov 2024 14:45:07 +0000 (15:45 +0100)] 
[3.13] Fix indentation for contextlib.asynccontextmanager docs (GH-127333) (#127334)

Fix indentation for contextlib.asynccontextmanager docs (GH-127333)
(cherry picked from commit 9328db7652677a23192cb51b0324a0fdbfa587c9)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
11 months ago[3.13] gh-122273: Support PyREPL history on Windows (#127141) (#127289)
Victor Stinner [Tue, 26 Nov 2024 11:17:13 +0000 (12:17 +0100)] 
[3.13] gh-122273: Support PyREPL history on Windows (#127141) (#127289)

gh-122273: Support PyREPL history on Windows (#127141)

Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
(cherry picked from commit 3c7a90a83146dc6e55f6f9ecd9af0bf9682f98a6)

11 months ago[3.13] gh-126316: Make grp.getgrall() thread-safe: add a mutex (#127055) (#127104)
Victor Stinner [Tue, 26 Nov 2024 11:01:50 +0000 (12:01 +0100)] 
[3.13] gh-126316: Make grp.getgrall() thread-safe: add a mutex (#127055) (#127104)

* gh-126316: Make grp.getgrall() thread-safe: add a mutex (#127055)

grpmodule.c is no longer built with the limited C API, since PyMutex
is excluded from the limited C API.

(cherry picked from commit 3c2bd66e21bd8de69a89ebf09ff9d8e78ddfb839)

* Revert ABI changes

Don't use Argument Clinic for grp.getgrgid() to avoid changing the
ABI (change PyInterpreterState structure by adding an "id"
identifier).

11 months ago[3.13] gh-127183: Add `_ctypes.CopyComPointer` tests (GH-127184) (GH-127251)
Miss Islington (bot) [Tue, 26 Nov 2024 10:13:08 +0000 (11:13 +0100)] 
[3.13] gh-127183: Add `_ctypes.CopyComPointer` tests (GH-127184) (GH-127251)

gh-127183: Add `_ctypes.CopyComPointer` tests (GH-127184)

* Make `create_shelllink_persist` top level function.

* Add `CopyComPointerTests`.

* Add more tests.

* Update tests.

* Add assertions for `Release`'s return value.
(cherry picked from commit c7f1e3e150ca181f4b4bd1e5b59d492749f00be6)

Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
11 months ago[3.13] gh-101100: Fix sphinx warnings in `howto/*` (GH-127084) (#127287)
Miss Islington (bot) [Tue, 26 Nov 2024 08:27:25 +0000 (09:27 +0100)] 
[3.13] gh-101100: Fix sphinx warnings in `howto/*` (GH-127084) (#127287)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
11 months ago[3.13] gh-127265: Remove single quotes from 'arrow's in tutorial/errors.rst (GH-127269)
Miss Islington (bot) [Mon, 25 Nov 2024 21:39:59 +0000 (22:39 +0100)] 
[3.13] gh-127265: Remove single quotes from 'arrow's in tutorial/errors.rst (GH-127269)

(cherry picked from commit 26ff32b30553e1f7b0cc822835ad2da8890c180c)

Co-authored-by: funkyrailroad <funkyrailroad@users.noreply.github.com>
11 months ago[3.13] gh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the first value...
Miss Islington (bot) [Mon, 25 Nov 2024 17:56:42 +0000 (18:56 +0100)] 
[3.13] gh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the first value (GH-127219) (#127262)

gh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the first value (GH-127219)
(cherry picked from commit a2ee89968299fc4f0da4b5a4165025b941213ba5)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] gh-126384: Add tests to verify the behavior of basic COM methods. (GH-126610...
Miss Islington (bot) [Mon, 25 Nov 2024 12:18:27 +0000 (13:18 +0100)] 
[3.13] gh-126384: Add tests to verify the behavior of basic COM methods. (GH-126610) (GH-127159)

(cherry picked from commit 7725c0371a93be3ccfaff4871014a80bdf0ea274)

Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
11 months ago[3.13] gh-101100: Fix sphinx warnings of removed opcodes (GH-127222) (#127239)
Yuki Kobayashi [Mon, 25 Nov 2024 08:50:48 +0000 (17:50 +0900)] 
[3.13] gh-101100: Fix sphinx warnings of removed opcodes (GH-127222) (#127239)

11 months ago[3.13] Improve `pathname2url()` and `url2pathname()` docs (GH-127125) (#127232)
Miss Islington (bot) [Sun, 24 Nov 2024 17:46:54 +0000 (18:46 +0100)] 
[3.13] Improve `pathname2url()` and `url2pathname()` docs (GH-127125) (#127232)

Improve `pathname2url()` and `url2pathname()` docs (GH-127125)

These functions have long sown confusion among Python developers. The
existing documentation says they deal with URL path components, but that
doesn't fit the evidence on Windows:

    >>> pathname2url(r'C:\foo')
    '///C:/foo'
    >>> pathname2url(r'\\server\share')
    '////server/share'  # or '//server/share' as of quite recently

If these were URL path components, they would imply complete URLs like
`file://///C:/foo` and `file://////server/share`. Clearly this isn't right.
Yet the implementation in `nturl2path` is deliberate, and the
`url2pathname()` function correctly inverts it.

On non-Windows platforms, the behaviour until quite recently is to simply
quote/unquote the path without adding or removing any leading slashes. This
behaviour is compatible with *both* interpretations -- 1) the value is a
URL path component (existing docs), and 2) the value is everything
following `file:` (this commit)

The conclusion I draw is that these functions operate on everything after
the `file:` prefix, which may include an authority section. This is the
only explanation that fits both the  Windows and non-Windows behaviour.
It's also a better match for the function names.
(cherry picked from commit 307c63358681d669ae39e5ecd814bded4a93443a)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.13] Fix macro expansions in critical section docs (GH-127226) (#127229)
Miss Islington (bot) [Sun, 24 Nov 2024 17:26:40 +0000 (18:26 +0100)] 
[3.13] Fix macro expansions in critical section docs (GH-127226) (#127229)

(cherry picked from commit 2bb7846cacb342246aada5ed92d323e54c946063)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
11 months ago[3.13] gh-109413: Enable mypy's `disallow_any_generics` setting when checking `libreg...
Miss Islington (bot) [Sun, 24 Nov 2024 08:40:14 +0000 (09:40 +0100)] 
[3.13] gh-109413: Enable mypy's `disallow_any_generics` setting when checking `libregrtest` (GH-127033) (#127034)

gh-109413: Enable mypy's `disallow_any_generics` setting when checking `libregrtest` (GH-127033)
(cherry picked from commit 824afbf548e7128ca57c6faf45cfd6b066a6ee45)

Co-authored-by: sobolevn <mail@sobolevn.me>
11 months ago[3.13] gh-126991: Add tests for unpickling bad object state (GH-127031) (GH-127063)
Miss Islington (bot) [Sun, 24 Nov 2024 03:16:54 +0000 (04:16 +0100)] 
[3.13] gh-126991: Add tests for unpickling bad object state (GH-127031) (GH-127063)

This catches a memory leak in loading the BUILD opcode.
(cherry picked from commit addb225f3823b03774cddacce35214dd471bec46)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.13] gh-126896: Fix docs about `asyncio.start_server()` (GH-126897) (GH-126934)
Miss Islington (bot) [Sun, 24 Nov 2024 02:55:58 +0000 (03:55 +0100)] 
[3.13] gh-126896: Fix docs about `asyncio.start_server()` (GH-126897) (GH-126934)

gh-126896: Fix docs about `asyncio.start_server()` (GH-126897)
(cherry picked from commit 0c5c80928c476ac0dcb9a053b15a562af899cfba)

Co-authored-by: beavailable <beavailable@proton.me>
11 months ago[3.13] Fix "useable" typo in docs (GH-127200) (#127207)
Miss Islington (bot) [Sat, 23 Nov 2024 22:50:06 +0000 (23:50 +0100)] 
[3.13] Fix "useable" typo in docs (GH-127200) (#127207)

Fix "useable" typo in docs (GH-127200)

Fix typo in docs
(cherry picked from commit dbd23790dbd662169905be6300259992639d4e69)

Co-authored-by: Stan U <89152624+StanFromIreland@users.noreply.github.com>
11 months ago[3.13] Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667) (#127201)
Miss Islington (bot) [Sat, 23 Nov 2024 19:54:12 +0000 (20:54 +0100)] 
[3.13] Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667) (#127201)

Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667)
(cherry picked from commit e3038e976b25a58f512d8c7083a752c89436eb0d)

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
11 months ago[3.13] Enable aarch64 Ubuntu CI jobs (GH-125786) (GH-127170)
Łukasz Langa [Sat, 23 Nov 2024 09:40:25 +0000 (10:40 +0100)] 
[3.13] Enable aarch64 Ubuntu CI jobs (GH-125786) (GH-127170)

This change enables custom GHA runners for Ubuntu-24.04 that run on Arm hardware. It also prepares for Windows runners on Arm hardware, but doesn't enable that just yet, because the Arm GHA runner images for Windows need to be updated.
(cherry picked from commit 8214e0f709010a0e1fa06dc2ce004b5f6103cc6b)

11 months ago[3.13] Fix a few typos found in the docs (GH-127126) (GH-127181)
Miss Islington (bot) [Sat, 23 Nov 2024 00:09:35 +0000 (01:09 +0100)] 
[3.13] Fix a few typos found in the docs (GH-127126) (GH-127181)

Fix a few typos found in the docs (GH-127126)
(cherry picked from commit 39e60aeb3837f1f23d8b7f30d3b8d9faf805ef88)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
11 months ago[3.13] gh-109746: Make _thread.start_new_thread delete state of new thread on its...
Serhiy Storchaka [Fri, 22 Nov 2024 19:55:44 +0000 (21:55 +0200)] 
[3.13] gh-109746: Make _thread.start_new_thread delete state of new thread on its startup failure (GH-109761) (GH-127171)

If Python fails to start newly created thread
due to failure of underlying PyThread_start_new_thread() call,
its state should be removed from interpreter' thread states list
to avoid its double cleanup.

(cherry picked from commit ca3ea9ad05c3d876a58463595e5b4228fda06936)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
11 months ago[3.13] gh-122544: Change OS image in GitHub Actions to Ubuntu 24.04 (#122566) (#126619)
Damien [Fri, 22 Nov 2024 19:18:57 +0000 (03:18 +0800)] 
[3.13] gh-122544: Change OS image in GitHub Actions to Ubuntu 24.04 (#122566) (#126619)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
11 months ago[3.13] gh-88110: Clear concurrent.futures.thread._threads_queues after fork to avoid...
Miss Islington (bot) [Fri, 22 Nov 2024 17:08:18 +0000 (18:08 +0100)] 
[3.13] gh-88110: Clear concurrent.futures.thread._threads_queues after fork to avoid joining parent process' threads (GH-126098) (GH-127163)

Threads are gone after fork, so clear the queues too. Otherwise the
child process (here created via multiprocessing.Process) crashes on
interpreter exit.

(cherry picked from commit 1848ce61f349533ae5892a8c24c2e0e3c364fc8a)

Co-authored-by: Andrei Bodrov <Drino@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.13] gh-109413: Fix libregrtest get_running() (GH-127153) (#127157)
Miss Islington (bot) [Fri, 22 Nov 2024 16:34:07 +0000 (17:34 +0100)] 
[3.13] gh-109413: Fix libregrtest get_running() (GH-127153) (#127157)

gh-109413: Fix libregrtest get_running() (GH-127153)

Skip threads which are not running.
(cherry picked from commit 0cb20177d667f0058f3d8d808abaf340e8345f04)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] gh-127001: Fix PATHEXT issues in shutil.which() on Windows (GH-127035) (GH...
Miss Islington (bot) [Fri, 22 Nov 2024 16:18:44 +0000 (17:18 +0100)] 
[3.13] gh-127001: Fix PATHEXT issues in shutil.which() on Windows (GH-127035) (GH-127156)

* Name without a PATHEXT extension is only searched if the mode does not
  include X_OK.
* Support multi-component PATHEXT extensions (e.g. ".foo.bar").
* Support files without extensions in PATHEXT contains dot-only extension
  (".", "..", etc).
* Support PATHEXT extensions that end with a dot (e.g. ".foo.").
(cherry picked from commit 8899e85de100557899da05f0b37867a371a73800)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.13] gh-127065: Make `methodcaller` thread-safe in free threading build (GH-127109...
Miss Islington (bot) [Fri, 22 Nov 2024 14:51:40 +0000 (15:51 +0100)] 
[3.13] gh-127065: Make `methodcaller` thread-safe in free threading build (GH-127109) (GH-127150)

The `methodcaller` C vectorcall implementation uses an arguments array
that is shared across calls. The first argument is modified on every
invocation. This isn't thread-safe in the free threading build. I think
it's also not safe in general, but for now just disable it in the free
threading build.
(cherry picked from commit f83ca6962af973fff6a3124f4bd3d45fea4dd5b8)

Co-authored-by: Sam Gross <colesbury@gmail.com>
11 months ago[3.13] GH-122679: Add `register()` to argparse docs (GH-126939) (GH-127149)
Miss Islington (bot) [Fri, 22 Nov 2024 14:12:05 +0000 (15:12 +0100)] 
[3.13] GH-122679: Add `register()` to argparse docs (GH-126939) (GH-127149)

(cherry picked from commit fcfdb55465636afc256bc29781b283404d88e6ca)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
11 months ago[3.13] gh-127082: Replace "Windows only" with the `availability: Windows` in `ctypes...
Jun Komoda [Fri, 22 Nov 2024 13:09:53 +0000 (22:09 +0900)] 
[3.13] gh-127082: Replace "Windows only" with the `availability: Windows` in `ctypes` doc (GH-127099) (#127144)

(cherry picked from commit 3c770e3f0978d825c5ebea98fcd654660e7e135f)

11 months ago[3.13] GH-127078: `url2pathname()`: handle extra slash before UNC drive in URL path...
Miss Islington (bot) [Fri, 22 Nov 2024 04:37:30 +0000 (05:37 +0100)] 
[3.13] GH-127078: `url2pathname()`: handle extra slash before UNC drive in URL path (GH-127132) (#127135)

GH-127078: `url2pathname()`: handle extra slash before UNC drive in URL path (GH-127132)

Decode a file URI like `file://///server/share` as a UNC path like
`\\server\share`. This form of file URI is created by software the simply
prepends `file:///` to any absolute Windows path.
(cherry picked from commit 8c98ed846a7d7e50c4cf06f823d94737144dcf6a)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.13] GH-126766: `url2pathname()`: handle 'localhost' authority (GH-127129) (#127130)
Miss Islington (bot) [Fri, 22 Nov 2024 03:42:26 +0000 (04:42 +0100)] 
[3.13] GH-126766: `url2pathname()`: handle 'localhost' authority (GH-127129) (#127130)

GH-126766: `url2pathname()`: handle 'localhost' authority (GH-127129)

Discard any 'localhost' authority from the beginning of a `file:` URI. As a
result, file URIs like `//localhost/etc/hosts` are correctly decoded as
`/etc/hosts`.
(cherry picked from commit ebf564a1d3e2e81b9846535114e481d6096443d2)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.13] gh-126986: Stop Using _PyInterpreterState_FailIfNotRunning() (gh-127112)
Eric Snow [Thu, 21 Nov 2024 17:33:15 +0000 (10:33 -0700)] 
[3.13] gh-126986: Stop Using _PyInterpreterState_FailIfNotRunning() (gh-127112)

This is a pseudo-backport of d6b3e78 (gh-126988).  In that change for 3.14+, we dropped _PyInterpreterState_FailIfNotRunning() and added _PyErr_SetInterpreterAlreadyRunning().  Here, we replace usage of _PyInterpreterState_FailIfNotRunning() with the inlined equivalent of _PyErr_SetInterpreterAlreadyRunning(), without adding that function.  That way we avoid changing the 3.13 ABI.

11 months ago[3.13] gh-127020: Make `PyCode_GetCode` thread-safe for free threading (GH-127043...
Miss Islington (bot) [Thu, 21 Nov 2024 16:27:36 +0000 (17:27 +0100)] 
[3.13] gh-127020: Make `PyCode_GetCode` thread-safe for free threading (GH-127043) (GH-127107)

Some fields in PyCodeObject are lazily initialized. Use atomics and
critical sections to make their initializations and accesses thread-safe.
(cherry picked from commit 3926842117feffe5d2c9727e1899bea5ae2adb28)

Co-authored-by: Sam Gross <colesbury@gmail.com>
11 months ago[3.13] gh-124873: Tolerate 100 ms in TimerfdTests on Android (GH-127101) (#127105)
Miss Islington (bot) [Thu, 21 Nov 2024 15:29:01 +0000 (16:29 +0100)] 
[3.13] gh-124873: Tolerate 100 ms in TimerfdTests on Android (GH-127101) (#127105)

gh-124873: Tolerate 100 ms in TimerfdTests on Android (GH-127101)

On Android, TimerfdTests of test_os now uses 100 ms accuracy instead
of 10 ms.
(cherry picked from commit bab4b0462ebd782dd6965beb0ccae6341af43ceb)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months agogh-126780: Fix `ntpath.normpath()` for drive-relative paths (GH-126801)
Miss Islington (bot) [Thu, 21 Nov 2024 15:10:12 +0000 (16:10 +0100)] 
gh-126780: Fix `ntpath.normpath()` for drive-relative paths (GH-126801)

(cherry picked from commit 60ec854bc297e04718fe13db3605d0465bf8badb)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
11 months ago[3.13] gh-126727: Fix locale.nl_langinfo(locale.ERA) (GH-126730) (GH-127097)
Serhiy Storchaka [Thu, 21 Nov 2024 11:49:19 +0000 (13:49 +0200)] 
[3.13] gh-126727: Fix locale.nl_langinfo(locale.ERA) (GH-126730) (GH-127097)

It now returns multiple era description segments separated by semicolons.
Previously it only returned the first segment on platforms with Glibc.
(cherry picked from commit 4803cd0244847f286641c85591fda08b513cea52)

11 months ago[3.13] gh-126997: Fix support of non-ASCII strings in pickletools (GH-127062) (GH...
Miss Islington (bot) [Thu, 21 Nov 2024 11:40:52 +0000 (12:40 +0100)] 
[3.13] gh-126997: Fix support of non-ASCII strings in pickletools (GH-127062) (GH-127094)

* Fix support of STRING and GLOBAL opcodes with non-ASCII arguments.
* dis() now outputs non-ASCII bytes in STRING, BINSTRING and
  SHORT_BINSTRING arguments as escaped (\xXX).
(cherry picked from commit eaf217108226633c03cc5c4c90f0b6e4587c8803)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.13] GH-85168: Use filesystem encoding when converting to/from `file` URIs (GH...
Miss Islington (bot) [Wed, 20 Nov 2024 20:10:29 +0000 (21:10 +0100)] 
[3.13] GH-85168: Use filesystem encoding when converting to/from `file` URIs (GH-126852) (#127039)

GH-85168: Use filesystem encoding when converting to/from `file` URIs (GH-126852)

Adjust `urllib.request.url2pathname()` and `pathname2url()` to use the
filesystem encoding when quoting and unquoting file URIs, rather than
forcing use of UTF-8.

No changes are needed in the `nturl2path` module because Windows always
uses UTF-8, per PEP 529.
(cherry picked from commit c9b399fbdb01584dcfff0d7f6ad484644ff269c3)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.13] Run `apt update` before `apt install git` in autoconf CI job (GH-127070)
Miss Islington (bot) [Wed, 20 Nov 2024 19:44:17 +0000 (20:44 +0100)] 
[3.13] Run `apt update` before `apt install git` in autoconf CI job (GH-127070)

(cherry picked from commit 0af4ec30bd2e3a52350344d1011c0c125d6dcd71)

Co-authored-by: Zachary Ware <zach@python.org>
11 months ago[3.13] Doc: C API: `PyThreadState::on_delete` was removed in v3.13 (GH-126536) (...
Miss Islington (bot) [Wed, 20 Nov 2024 08:51:19 +0000 (09:51 +0100)] 
[3.13] Doc: C API: `PyThreadState::on_delete` was removed in v3.13 (GH-126536) (#127053)

Doc: C API: `PyThreadState::on_delete` was removed in v3.13 (GH-126536)
(cherry picked from commit 9bca3ef575a088d3330a2743e36423aa5f7bdad8)

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
11 months ago[3.13] gh-126991: Fix reference leak in loading pickle's opcode BUILD (GH-126990...
Miss Islington (bot) [Tue, 19 Nov 2024 18:19:39 +0000 (19:19 +0100)] 
[3.13] gh-126991: Fix reference leak in loading pickle's opcode BUILD (GH-126990) (GH-127018)

If PyObject_SetItem() fails in the `load_build()` function of _pickle.c, no DECREF for the `dict` variable.
(cherry picked from commit 29cbcbd73bbfd8c953c0b213fb33682c289934ff)

Co-authored-by: Justin Applegate <70449145+Legoclones@users.noreply.github.com>
11 months ago[3.13] gh-126980: Fix `bytearray.__buffer__` crash on `PyBUF_{READ,WRITE}` (GH-126981...
sobolevn [Tue, 19 Nov 2024 17:37:53 +0000 (20:37 +0300)] 
[3.13] gh-126980: Fix `bytearray.__buffer__` crash on `PyBUF_{READ,WRITE}` (GH-126981) (#127023)

(cherry picked from commit 3932e1db5353bbcf3e3c1133cc9d2cde654cb645)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] Update docs 'make serve' to suggest 'make htmllive' (GH-126969) (#127015)
Miss Islington (bot) [Tue, 19 Nov 2024 15:41:33 +0000 (16:41 +0100)] 
[3.13] Update docs 'make serve' to suggest 'make htmllive' (GH-126969) (#127015)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
11 months ago[3.13] gh-126594: Fix typeobject.c wrap_buffer() cast (GH-126754) (#127004)
Miss Islington (bot) [Tue, 19 Nov 2024 08:38:06 +0000 (09:38 +0100)] 
[3.13] gh-126594: Fix typeobject.c wrap_buffer() cast (GH-126754) (#127004)

gh-126594: Fix typeobject.c wrap_buffer() cast (GH-126754)

Reject flags smaller than INT_MIN.

(cherry picked from commit 84f07c3a4cbcfe488ccfb4030571be0bc4de7e45)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
11 months ago[3.13] Doc: Reorganize math module documentation (GH-126337) (#126998)
Sergey B Kirpichev [Tue, 19 Nov 2024 08:02:01 +0000 (11:02 +0300)] 
[3.13] Doc: Reorganize math module documentation (GH-126337) (#126998)

(cherry picked from commit ce453e6c2ffda657d9d728ea6372121e8264418e)

Co-authored-by: Joseph Martinot-Lagarde <contrebasse@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.13] gh-126911: Update credits output (GH-126913) (#126973)
Miss Islington (bot) [Mon, 18 Nov 2024 16:02:32 +0000 (17:02 +0100)] 
[3.13] gh-126911: Update credits output (GH-126913) (#126973)

Co-authored-by: Stan U <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
11 months ago[3.13] gh-109413: Enable `strict_optional = true` for `libregrtest/run_workers` ...
Miss Islington (bot) [Mon, 18 Nov 2024 14:50:31 +0000 (15:50 +0100)] 
[3.13] gh-109413: Enable `strict_optional = true` for `libregrtest/run_workers` (GH-126855) (#126967)

gh-109413: Enable `strict_optional = true` for `libregrtest/run_workers` (GH-126855)
(cherry picked from commit a1d9c8aa800dd7c9eb634f89646be10e9cfc9c8d)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
11 months ago[3.13] gh-126789: Correct sysconfig test exclusions for iOS and Android. (GH-126941...
Petr Viktorin [Mon, 18 Nov 2024 13:57:58 +0000 (14:57 +0100)] 
[3.13] gh-126789: Correct sysconfig test exclusions for iOS and Android. (GH-126941) (GH-126950)

(cherry picked from commit 3938fd60c0c88891b213097380aeea91a45bcd77)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
11 months ago[3.13] gh-126909: Fix running xattr tests on systems with lower limits (GH-126930...
Miss Islington (bot) [Mon, 18 Nov 2024 13:33:53 +0000 (14:33 +0100)] 
[3.13] gh-126909: Fix running xattr tests on systems with lower limits (GH-126930) (#126965)

gh-126909: Fix running xattr tests on systems with lower limits (GH-126930)

Modify the extended attribute tests to write fewer and smaller extended
attributes, in order to fit within filesystems with total xattr limit
of 1 KiB (e.g. ext4 with 1 KiB blocks).  Previously, the test would
write over 2 KiB, making it fail with ENOSPC on such systems.
(cherry picked from commit 2c0a21c1aad65ab8362491acf856eb574b1257ad)

Co-authored-by: Michał Górny <mgorny@gentoo.org>
11 months ago[3.13] gh-101955: Fix SystemError in possesive quantifier with alternative and group...
Miss Islington (bot) [Mon, 18 Nov 2024 12:13:08 +0000 (13:13 +0100)] 
[3.13] gh-101955: Fix SystemError in possesive quantifier with alternative and group (GH-111362) (GH-126962)

(cherry picked from commit f9c5573dedcb2f2e9ae152672ce157987cdea612)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.13] gh-67877: Fix memory leaks in terminated RE matching (GH-126840) (GH-126960)
Serhiy Storchaka [Mon, 18 Nov 2024 11:26:45 +0000 (13:26 +0200)] 
[3.13] gh-67877: Fix memory leaks in terminated RE matching (GH-126840) (GH-126960)

If SRE(match) function terminates abruptly, either because of a signal
or because memory allocation fails, allocated SRE_REPEAT blocks might
be never released.

Co-authored-by: <wjssz@users.noreply.github.com>
(cherry picked from commit 7538e7f5696408fa0aa02fce8a413a7dfac76a04)

11 months ago[3.13] gh-126167: Modify iOS Testbed to read arguments from Info.plist (GH-126169...
Miss Islington (bot) [Mon, 18 Nov 2024 00:50:54 +0000 (01:50 +0100)] 
[3.13] gh-126167: Modify iOS Testbed to read arguments from Info.plist (GH-126169) (#126940)

gh-126167: Modify iOS Testbed to read arguments from Info.plist (GH-126169)

11 months ago[3.13] Docs: re-create pages for removed modules to document their removal. (GH-12662...
Miss Islington (bot) [Sun, 17 Nov 2024 20:20:32 +0000 (21:20 +0100)] 
[3.13] Docs: re-create pages for removed modules to document their removal. (GH-126622) (#126709)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
11 months ago[3.13] gh-124452: Fix header mismatches when folding/unfolding with email message...
Miss Islington (bot) [Sun, 17 Nov 2024 20:06:18 +0000 (21:06 +0100)] 
[3.13] gh-124452: Fix header mismatches when folding/unfolding with email message (GH-125919) (#126917)

gh-124452: Fix header mismatches when folding/unfolding with email message (GH-125919)

The header-folder of the new email API has a long standing known buglet where
if the first token is longer than max_line_length, it puts that token on the next
line.  It turns out there is also a *parsing* bug when parsing such a header:
the space prefixing that first, non-empty line gets preserved and tacked on to
the start of the header value, which is not the expected behavior per the RFCs.
The bug arises from the fact that the parser assumed that there would be at
least one token on the line with the header, which is going to be true for
probably every email producer other than the python email library with its
folding buglet.  Clearly, though, this is a case that needs to be handled
correctly.  The fix is simple: strip the blanks off the start of the whole
value, not just the first physical line of the value.

(cherry picked from commit ed81971e6b26c34445f06850192b34458b029337)

Co-authored-by: RanKKI <hliu86.me@gmail.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>
11 months ago[3.13] gh-126554: ctypes: Correctly handle NULL dlsym values (GH-126555) (#126861)
Miss Islington (bot) [Sun, 17 Nov 2024 17:59:13 +0000 (18:59 +0100)] 
[3.13] gh-126554: ctypes: Correctly handle NULL dlsym values (GH-126555) (#126861)

For dlsym(), a return value of NULL does not necessarily indicate
an error [1].

Therefore, to avoid using stale (or NULL) dlerror() values, we must:

 1. clear the previous error state by calling dlerror()
 2. call dlsym()
 3. call dlerror()

If the return value of dlerror() is not NULL, an error occured.

In ctypes we choose to treat a NULL return value from dlsym()
as a "not found" error. This is the same as the fallback
message we use on Windows, Cygwin or when getting/formatting
the error reason fails.

[1]: https://man7.org/linux/man-pages/man3/dlsym.3.html

(cherry picked from commit 8717f792f7cc343599dc60daf80630cceb66145b)

Signed-off-by: Georgios Alexopoulos <grgalex@ba.uoa.gr>
Co-authored-by: George Alexopoulos <giorgosalexo0@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
11 months ago[3.13] GH-126789: fix some sysconfig data on late site initializations
Miss Islington (bot) [Sun, 17 Nov 2024 00:32:22 +0000 (01:32 +0100)] 
[3.13] GH-126789: fix some sysconfig data on late site initializations

Co-authored-by: Filipe Laíns 🇵🇸 <lains@riseup.net>
11 months ago[3.13] gh-126476: Raise IllegalMonthError for calendar.formatmonth() when the input...
Miss Islington (bot) [Fri, 15 Nov 2024 23:20:25 +0000 (00:20 +0100)] 
[3.13] gh-126476: Raise IllegalMonthError for calendar.formatmonth() when the input month is not correct (GH-126484) (GH-126879)

gh-126476: Raise IllegalMonthError for calendar.formatmonth() when the input month is not correct (GH-126484)
(cherry picked from commit 3be7498d2450519d5d8f63a35ef298db3b3d935b)

Co-authored-by: Nadeshiko Manju <me@manjusaka.me>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
11 months ago[3.13] Added a warning to the urljoin docs, indicating that it is not safe to use...
Miss Islington (bot) [Fri, 15 Nov 2024 23:15:27 +0000 (00:15 +0100)] 
[3.13] Added a warning to the urljoin docs, indicating that it is not safe to use with attacker controlled URLs (GH-126659) (#126888)

Added a warning to the urljoin docs, indicating that it is not safe to use with attacker controlled URLs (GH-126659)

This was flagged to me at a party today by someone who works in red-teaming as a frequently encountered footgun. Documenting the potentially unexpected behavior seemed like a good place to start.
(cherry picked from commit d6bcc154e93a0a20ab97187d3e8b726fffb14f8f)

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
11 months ago[3.13] gh-71936: Fix race condition in multiprocessing.Pool (GH-124973) (GH-126869)
Miss Islington (bot) [Fri, 15 Nov 2024 14:05:14 +0000 (15:05 +0100)] 
[3.13] gh-71936: Fix race condition in multiprocessing.Pool (GH-124973) (GH-126869)

Proxes of shared objects register a Finalizer in BaseProxy._incref(), and it
will call BaseProxy._decref() when it is GCed. This may cause a race condition
with Pool(maxtasksperchild=None) on Windows.

A connection would be closed and raised TypeError when a GC occurs between
_ConnectionBase._check_writable() and _ConnectionBase._send_bytes() in
_ConnectionBase.send() in the second or later task, and a new object
is allocated that shares the id() of a previously deleted one.

Instead of using the id() of the token (or the proxy), use a unique,
non-reusable number.

(cherry picked from commit ba088c8f9cf7163b0f28c507cb1343befe21997e)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Akinori Hattori <hattya@gmail.com>
11 months ago[3.13] gh-126312: Don't traverse frozen objects on the free-threaded build (GH-126338...
Peter Bierma [Fri, 15 Nov 2024 13:46:00 +0000 (08:46 -0500)] 
[3.13] gh-126312: Don't traverse frozen objects on the free-threaded build (GH-126338) (#126866)

* Fix merge conflicts.

* [3.13] gh-126312: Don't traverse frozen objects on the free-threaded build (GH-126338)

Also, _PyGC_Freeze() no longer freezes unreachable objects.

(cherry picked from commit d4c72fed8cba8e15ab7bb6c30a92bc9f2c8f0a2c)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
---------

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
11 months agogh-118973: Add _tkinter to freethreaded MSI (GH-126768)
Miss Islington (bot) [Fri, 15 Nov 2024 13:10:07 +0000 (14:10 +0100)] 
gh-118973: Add _tkinter to freethreaded MSI (GH-126768)

(cherry picked from commit 9332a6f82506f819f591466eb03213be2c8d1808)

Co-authored-by: Steve Dower <steve.dower@python.org>
11 months ago[3.13] gh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance (GH...
Miss Islington (bot) [Fri, 15 Nov 2024 13:06:57 +0000 (14:06 +0100)] 
[3.13] gh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance (GH-126182) (GH-126825)

gh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance (GH-126182)

* gh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance

This changes nothing changes for CPython supported platforms,
but hints how to deal with platforms that stick to the letter of
the spec.
It also marks `socket.getaddrinfo` as a wrapper around `getaddrinfo(3)`;
specifically, workarounds to make the function work consistently across
platforms are out of scope in its code.

Include wording similar to the POSIX's “by providing options and by
limiting the returned information”, which IMO suggests that the
hints limit the resulting list compared to the defaults, *but* can
be interpreted differently. Details are added in a note.

Specifically say that this wraps the underlying C function. So, the
details are in OS docs. The “full range of results” bit goes away.

Use `AF_UNSPEC` rather than zero for the *family* default, although
I don't think a system where it's nonzero would be very usable.

Suggest setting proto and/or type (with examples, as the appropriate
values aren't obvious). Say why you probably want to do that that
on all systems; mention the behavior on the “letter of the spec”
systems.

Suggest that the results should be tried in order, which is,
AFAIK best practice -- see RFC 6724 section 2, and its predecessor
from 2003 (which are specific to IP, but indicate how people use this):

> Well-behaved applications SHOULD iterate through the list of
> addresses returned from `getaddrinfo()` until they find a working address.

(cherry picked from commit ff0ef0a54bef26fc507fbf9b7a6009eb7d3f17f5)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
11 months ago[3.13] gh-126413: Add translation tests for getopt and optparse (GH-126698) (GH-126755)
Tomas R. [Fri, 15 Nov 2024 11:06:54 +0000 (12:06 +0100)] 
[3.13] gh-126413: Add translation tests for getopt and optparse (GH-126698) (GH-126755)

(cherry picked from commit dff074d1446bab23578a6b228b0c59a17006299c)

11 months ago[3.13] GH-126766: `url2pathname()`: handle empty authority section. (GH-126767) ...
Miss Islington (bot) [Thu, 14 Nov 2024 23:52:36 +0000 (00:52 +0100)] 
[3.13] GH-126766: `url2pathname()`: handle empty authority section. (GH-126767) (#126836)

GH-126766: `url2pathname()`: handle empty authority section. (GH-126767)

Discard two leading slashes from the beginning of a `file:` URI if they
introduce an empty authority section. As a result, file URIs like
`///etc/hosts` are correctly parsed as `/etc/hosts`.
(cherry picked from commit cae9d9d20f61cdbde0765efa340b6b596c31b67f)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.13] gh-126807: pygettext: Do not attempt to extract messages from function definit...
Miss Islington (bot) [Thu, 14 Nov 2024 22:43:33 +0000 (23:43 +0100)] 
[3.13] gh-126807: pygettext: Do not attempt to extract messages from function definitions. (GH-126808) (GH-126846)

Fixes a bug where pygettext would attempt
to extract a message from a code like this:

def _(x): pass

This is because pygettext only looks at one
token at a time and '_(x)' looks like a
function call.

However, since 'x' is not a string literal,
it would erroneously issue a warning.
(cherry picked from commit 9a456383bed52010b90bd491277ea855626a7bba)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
11 months ago[3.13] gh-126433: Fix compiler warnings on 32-bit Windows (#126444) (#126827)
Victor Stinner [Thu, 14 Nov 2024 12:21:27 +0000 (13:21 +0100)] 
[3.13] gh-126433: Fix compiler warnings on 32-bit Windows (#126444) (#126827)

gh-126433: Fix compiler warnings on 32-bit Windows (#126444)

(cherry picked from commit 0b67ce930a56c4ffd597b1a658ddcbacfb40e798)

11 months ago[3.13] gh-109413: Enable `strict_optional` for `libregrtest/main.py` (GH-126394)...
sobolevn [Thu, 14 Nov 2024 10:51:34 +0000 (13:51 +0300)] 
[3.13] gh-109413: Enable `strict_optional` for `libregrtest/main.py` (GH-126394) (#126802)

(cherry picked from commit 12ca7e622ff21ba3b7c90c62be6f6f82d543f25b)

11 months ago[3.13] gh-126433: Change channel_info.count to int64_t (GH-126447) (#126826)
Miss Islington (bot) [Thu, 14 Nov 2024 10:32:09 +0000 (11:32 +0100)] 
[3.13] gh-126433: Change channel_info.count to int64_t (GH-126447) (#126826)

gh-126433: Change channel_info.count to int64_t (GH-126447)

Fix compiler warnings on 32-bit Windows: change channel_info.count
type from Py_ssize_t to int64_t in _interpchannelsmodule.c.
(cherry picked from commit 09d7083962062acfef7e7a9a309a01fb70ad8276)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] Document that return-less user-defined functions return None (GH-126769) ...
Miss Islington (bot) [Thu, 14 Nov 2024 09:46:58 +0000 (10:46 +0100)] 
[3.13] Document that return-less user-defined functions return None (GH-126769) (#126822)

Document that return-less user-defined functions return None (GH-126769)
(cherry picked from commit e0692f11650acb6c2eed940eb94650b4703c072e)

Co-authored-by: John Marshall <jmarshall@hey.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
11 months ago[3.13] Doc: Recommend shlex.quote alongside pipes removal (GH-126570) (#126820)
Miss Islington (bot) [Thu, 14 Nov 2024 05:08:22 +0000 (06:08 +0100)] 
[3.13] Doc: Recommend shlex.quote alongside pipes removal (GH-126570) (#126820)

Doc: Recommend shlex.quote alongside pipes removal (GH-126570)

One of the most common reasons I see the old `pipes` module still in use
when porting to Python 3.13 is for the undocumented `pipes.quote`
function, which can easily be replaced with `shlex.quote`.  I think it's
worth specifically calling this out, since being directed to the
`subprocess` module would be confusing in this case.
(cherry picked from commit 73e34b680852794d110cd806505b3d74d9d593db)

Co-authored-by: Colin Watson <cjwatson@debian.org>
11 months ago[3.13] gh-126731: Update outdated project information in `pprint.pp` doc (GH-126732...
Miss Islington (bot) [Thu, 14 Nov 2024 05:04:03 +0000 (06:04 +0100)] 
[3.13] gh-126731: Update outdated project information in `pprint.pp` doc (GH-126732) (#126818)

gh-126731: Update outdated project information in `pprint.pp` doc (GH-126732)
(cherry picked from commit 6a93a1adbb56a64ec6d20e8aab911439998502c9)

Co-authored-by: Wulian <xiguawulian@gmail.com>
11 months ago[3.13] gh-124448: Update bundled Tcl/Tk in macOS installer to 8.6.15. (GH-125801)
Miss Islington (bot) [Thu, 14 Nov 2024 04:28:22 +0000 (05:28 +0100)] 
[3.13] gh-124448: Update bundled Tcl/Tk in macOS installer to 8.6.15. (GH-125801)

(cherry picked from commit fc9e6bf53d1c9ce2b5f802864e0da265a77c111f)

Co-authored-by: Ned Deily <nad@python.org>
11 months ago[3.13] GH-118289: Fix handling of non-directories in `posixpath.realpath()` (GH...
Barney Gale [Wed, 13 Nov 2024 23:32:56 +0000 (23:32 +0000)] 
[3.13] GH-118289: Fix handling of non-directories in `posixpath.realpath()`  (GH-120127) (#126815)

In strict mode, raise `NotADirectoryError` if we encounter a non-directory
while we still have path parts left to process.

We use a `part_count` variable rather than `len(rest)` because the `rest`
stack also contains markers for unresolved symlinks.
(cherry picked from commit fd4b5453df74e249987553b12c14ad75fafa4991)

11 months ago[3.13] GH-126606: don't write incomplete pyc files (GH-126627) (GH-126809)
Miss Islington (bot) [Wed, 13 Nov 2024 22:49:09 +0000 (23:49 +0100)] 
[3.13] GH-126606: don't write incomplete pyc files (GH-126627) (GH-126809)

GH-126606: don't write incomplete pyc files (GH-126627)
(cherry picked from commit c695e37a3f95c225ee08d1e882d23fa200b5ec34)

Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Brett Cannon <brett@python.org>
11 months ago[3.13] gh-126188: Update bundled pip to 24.3.1 (gh-126805) (#126806)
Miss Islington (bot) [Wed, 13 Nov 2024 21:51:57 +0000 (22:51 +0100)] 
[3.13] gh-126188: Update bundled pip to 24.3.1 (gh-126805) (#126806)

gh-126188: Update bundled pip to 24.3.1 (gh-126805)

Update bundled pip to 24.3.1
(cherry picked from commit f6b0361c17552197f44be16435e4a5cb4b1d60ca)

Co-authored-by: Stéphane Bidoul <stephane.bidoul@gmail.com>
11 months ago[3.13] gh-126341: add release check to `__iter__` method of `memoryview` (GH-126759...
Miss Islington (bot) [Wed, 13 Nov 2024 19:05:59 +0000 (20:05 +0100)] 
[3.13] gh-126341: add release check to `__iter__` method of `memoryview` (GH-126759) (#126778)

gh-126341: add release check to `__iter__` method of `memoryview` (GH-126759)
(cherry picked from commit a12690ef49e8fc8a3af4c5f1757eb3caffb35e03)

Co-authored-by: Ritvik Pasham <ritvikpasham@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: sobolevn <mail@sobolevn.me>
11 months ago[3.13] gh-126623: Update libexpat to 2.6.4, make future updates easier (GH-126792...
Miss Islington (bot) [Wed, 13 Nov 2024 18:56:17 +0000 (19:56 +0100)] 
[3.13] gh-126623: Update libexpat to 2.6.4, make future updates easier (GH-126792) (GH-126796)

gh-126623: Update libexpat to 2.6.4, make future updates easier (GH-126792)

Update libexpat to 2.6.4, make future updates easier.
(cherry picked from commit 3c9996909402fadc98e6ca2a64e75a71a7427352)

Co-authored-by: Seth Michael Larson <seth@python.org>
11 months ago[3.13] gh-126456: Fix _pyrepl curses tigetstr() (GH-126472) (#126790)
Miss Islington (bot) [Wed, 13 Nov 2024 17:19:03 +0000 (18:19 +0100)] 
[3.13] gh-126456: Fix _pyrepl curses tigetstr() (GH-126472) (#126790)

gh-126456: Fix _pyrepl curses tigetstr() (GH-126472)
(cherry picked from commit b2bbdc56e3276f3b37ea5cf5f73f49c4cce6d9f6)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] gh-104745: Limit starting a patcher more than once without stopping it (GH...
Miss Islington (bot) [Wed, 13 Nov 2024 08:46:12 +0000 (09:46 +0100)] 
[3.13] gh-104745: Limit starting a patcher more than once without stopping it (GH-126649) (#126772)

gh-104745: Limit starting a patcher more than once without stopping it (GH-126649)

Previously, this would cause an `AttributeError` if the patch stopped more than once after this, and would also disrupt the original patched object.

---------

(cherry picked from commit 1e40c5ba47780ddd91868abb3aa064f5ba3015e4)

Co-authored-by: Red4Ru <39802734+Red4Ru@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.13] bpo-46128: Strip IsolatedAsyncioTestCase frames from reported stacktraces...
Miss Islington (bot) [Wed, 13 Nov 2024 04:48:30 +0000 (05:48 +0100)] 
[3.13] bpo-46128: Strip IsolatedAsyncioTestCase frames from reported stacktraces (GH-30196) (#126770)

bpo-46128: Strip IsolatedAsyncioTestCase frames from reported stacktraces (GH-30196)

---------

(cherry picked from commit 2e39d77ddeb51505d65fd54ccfcd72615c6b1927)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>