]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
10 months ago[3.12] gh-128014: Fix passing default='' to the tkinter method wm_iconbitmap() ...
Serhiy Storchaka [Thu, 2 Jan 2025 16:21:00 +0000 (18:21 +0200)] 
[3.12] gh-128014:  Fix passing default='' to the tkinter method wm_iconbitmap() (GH-128015) (GH-128420)

(cherry picked from commit 58e9f95c4aa970db32a94b9152b51ede22f823bd)

Co-authored-by: Zhikang Yan <2951256653@qq.com>
10 months ago[3.12] Revert "Doc: Show object descriptions in the table of contents (GH-125757...
Miss Islington (bot) [Thu, 2 Jan 2025 14:41:25 +0000 (15:41 +0100)] 
[3.12] Revert "Doc: Show object descriptions in the table of contents (GH-125757)" (GH-128406) (#128414)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
10 months ago[3.12] gh-123925: Fix building curses on platforms without libncursesw (GH-128405...
Miss Islington (bot) [Thu, 2 Jan 2025 11:54:43 +0000 (12:54 +0100)] 
[3.12] gh-123925: Fix building curses on platforms without libncursesw (GH-128405) (GH-128408)

(cherry picked from commit 8d16919a06a55a50756bf083221a6f6cab43de50)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
10 months ago[3.12] gh-128349: Use `.. data::` instead of `.. class::` for pre-defined decimal...
Miss Islington (bot) [Thu, 2 Jan 2025 07:30:39 +0000 (08:30 +0100)] 
[3.12] gh-128349: Use `.. data::` instead of `.. class::` for pre-defined decimal `Context` objects (GH-128379) (#128402)

gh-128349: Use `.. data::` instead of `.. class::` for pre-defined decimal `Context` objects (GH-128379)
(cherry picked from commit 60c65184695a3eab766b3bc26fc99f695deb998f)

Co-authored-by: abkmystery <36216019+abkmystery@users.noreply.github.com>
10 months ago[3.12] Reword `about.rst` to not limit Sphinx (GH-128325) (#128383)
Miss Islington (bot) [Tue, 31 Dec 2024 21:31:21 +0000 (22:31 +0100)] 
[3.12] Reword `about.rst` to not limit Sphinx (GH-128325) (#128383)

Reword `about.rst` to not limit Sphinx (GH-128325)
(cherry picked from commit c5438fdf4706a70bdd19338edc000dacffff6837)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
10 months ago[3.12] gh-88834: Unify the instance check for typing.Union and types.UnionType (GH...
Miss Islington (bot) [Tue, 31 Dec 2024 08:19:45 +0000 (09:19 +0100)] 
[3.12] gh-88834: Unify the instance check for typing.Union and types.UnionType (GH-128363) (GH-128371)

Union now uses the instance checks against its parameters instead of
the subclass checks.
(cherry picked from commit b2ac70a62ad1be8e037ce45ccf5f1b753ea5e64b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
10 months ago[3.12] gh-128342: Specify timeout unit in subprocess docstrings (GH-128343) (#128366)
Miss Islington (bot) [Mon, 30 Dec 2024 21:14:27 +0000 (22:14 +0100)] 
[3.12] gh-128342: Specify timeout unit in subprocess docstrings (GH-128343) (#128366)

gh-128342: Specify timeout unit in subprocess docstrings (GH-128343)

Specify timeout unit (seconds) in subprocess docstrings
(cherry picked from commit dafe7a44630aa32bb411cceb45c7b7df725e3fe3)

Co-authored-by: n-l-i <57808975+n-l-i@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
10 months ago[3.12] gh-128321: Set LIBS instead of LDFLAGS when checking sqlite3 requirements...
Miss Islington (bot) [Mon, 30 Dec 2024 17:42:49 +0000 (18:42 +0100)] 
[3.12] gh-128321: Set LIBS instead of LDFLAGS when checking sqlite3 requirements (GH-128322) (#128355)

(cherry picked from commit 81376fef76a53fb79893bfa9c9db18d97c228fbe)

Co-authored-by: Zanie Blue <contact@zanie.dev>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
10 months ago[3.12] gh-128317: Document `calendar.TextCalendar.formatweek` (GH-128353) (#128358)
Miss Islington (bot) [Mon, 30 Dec 2024 17:40:31 +0000 (18:40 +0100)] 
[3.12] gh-128317: Document `calendar.TextCalendar.formatweek` (GH-128353) (#128358)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
10 months ago[3.12] gh-127586: multiprocessing.Pool does not properly restore blocked signals...
Miss Islington (bot) [Sun, 29 Dec 2024 19:02:59 +0000 (20:02 +0100)] 
[3.12] gh-127586: multiprocessing.Pool does not properly restore blocked signals (try 2) (GH-128011) (#128299)

gh-127586: multiprocessing.Pool does not properly restore blocked signals (try 2) (GH-128011)

Correct pthread_sigmask in resource_tracker to restore old signals

Using SIG_UNBLOCK to remove blocked "ignored signals" may accidentally
cause side effects if the calling parent already had said signals
blocked to begin with and did not intend to unblock them when
creating a pool. Use SIG_SETMASK instead with the previous mask of
blocked signals to restore the original blocked set.
(cherry picked from commit aeb9b65aa26444529e4adc7d6e5b0d3dd9889ec2)

Co-authored-by: Stephen Hansen <stephen.paul.hansen@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
10 months ago[3.12] Mention loop_factory argument in docstring for asyncio.run() (GH-128288) ...
Miss Islington (bot) [Fri, 27 Dec 2024 14:15:40 +0000 (15:15 +0100)] 
[3.12] Mention loop_factory argument in docstring for asyncio.run() (GH-128288) (#128292)

Mention loop_factory argument in docstring for asyncio.run() (GH-128288)
(cherry picked from commit 0b5f1fae573a2c658eb000433ad7b87e9c40c697)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
10 months ago[3.12] gh-127537: Add __class_getitem__ to the python implementation of functools...
Shantanu [Fri, 27 Dec 2024 01:25:07 +0000 (17:25 -0800)] 
[3.12] gh-127537: Add __class_getitem__ to the python implementation of functools.partial (#127537) (#128282)

gh-127537: Add __class_getitem__ to the python implementation of functools.partial (#127537)

(cherry picked from commit 401bba6b58497ce59e7b45ad33e43ae8c67abcb9)

Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
10 months ago[3.12] gh-128198: Add missing error checks for usages of PyIter_Next() (GH-128199...
Serhiy Storchaka [Thu, 26 Dec 2024 10:38:48 +0000 (12:38 +0200)] 
[3.12] gh-128198: Add missing error checks for usages of PyIter_Next() (GH-128199) (GH-128273)

(cherry picked from commit 5c814c83cdd3dc42bd9682106ffb7ade7ce6b5b3)

Co-authored-by: Yan Yanchii <yyanchiy@gmail.com>
10 months ago[3.12] gh-128227: Regenerate `Doc/requirements-oldest-sphinx.txt` (GH-128228) (#128230)
Miss Islington (bot) [Tue, 24 Dec 2024 20:51:06 +0000 (21:51 +0100)] 
[3.12] gh-128227: Regenerate `Doc/requirements-oldest-sphinx.txt` (GH-128228) (#128230)

gh-128227: Regenerate `Doc/requirements-oldest-sphinx.txt` (GH-128228)
(cherry picked from commit 7985d460c731b2c48419a33fc1820f9512bb6f21)

Co-authored-by: Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
10 months ago[3.12] gh-126664: revert: Use `else` instead of `finally` in docs explaining "with...
Miss Islington (bot) [Tue, 24 Dec 2024 18:56:03 +0000 (19:56 +0100)] 
[3.12] gh-126664: revert: Use `else` instead of `finally` in docs explaining "with" (GH-128169) (#128171)

gh-126664: revert: Use `else` instead of `finally` in docs explaining "with" (GH-128169)

Revert "gh-126664: Use `else` instead of `finally` in "The with statement" documentation. (GH-126665)"

This reverts commit 25257d61cfccc3b4189f96390a5c4db73fd5302c.
(cherry picked from commit 228f275737615cc9be713a8c3f9325b359bf8aec)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
10 months ago[3.12] gh-127847: Fix position in the special-cased zipfile seek (GH-127856) (#128226)
Miss Islington (bot) [Tue, 24 Dec 2024 16:15:45 +0000 (17:15 +0100)] 
[3.12] gh-127847: Fix position in the special-cased zipfile seek (GH-127856) (#128226)

gh-127847: Fix position in the special-cased zipfile seek (GH-127856)

---------
(cherry picked from commit 7ed6c5c6961d0849f163d4d449fb36bae312b6bc)

Co-authored-by: Dima Ryazanov <dima@bucket.xxx>
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: Jason R. Coombs <jaraco@jaraco.com>
10 months agogh-128217: Validate the normalized_environment variable instead of the similarly...
Miss Islington (bot) [Tue, 24 Dec 2024 13:25:16 +0000 (14:25 +0100)] 
gh-128217: Validate the normalized_environment variable instead of the similarly named function (GH-128220)

(cherry picked from commit 3ddd70ceaaf67b111ee4251817e150396d6d10a9)

Co-authored-by: Sergey Muraviov <smurav@mail.ru>
10 months ago[3.12] gh-128049: Fix type confusion bug with the return value of a custom ExceptionG...
Miss Islington (bot) [Fri, 20 Dec 2024 20:19:12 +0000 (21:19 +0100)] 
[3.12] gh-128049: Fix type confusion bug with the return value of a custom ExceptionGroup split function (GH-128079) (#128140)

gh-128049: Fix type confusion bug with the return value of a custom ExceptionGroup split function (GH-128079)
(cherry picked from commit 3879ca0100942ae15a09ac22889cbe3e46d424eb)

Co-authored-by: Nico-Posada <102486290+Nico-Posada@users.noreply.github.com>
10 months ago[3.12] gh-128116: Skip test_socket VSOCK testStream() on PermissionError (GH-128120...
Miss Islington (bot) [Fri, 20 Dec 2024 13:39:26 +0000 (14:39 +0100)] 
[3.12] gh-128116: Skip test_socket VSOCK testStream() on PermissionError (GH-128120) (#128124)

gh-128116: Skip test_socket VSOCK testStream() on PermissionError (GH-128120)
(cherry picked from commit cbfe3023e46b544b80ea1a38a8c900c6fb881554)

Co-authored-by: Victor Stinner <vstinner@python.org>
10 months ago[3.12] gh-128069: brew link --overwrite tcl-tk@8 to prevent conflict with GitHub...
Miss Islington (bot) [Fri, 20 Dec 2024 13:07:04 +0000 (14:07 +0100)] 
[3.12] gh-128069: brew link --overwrite tcl-tk@8 to prevent conflict with GitHub image's version (GH-128090) (#128125)

gh-128069: brew link --overwrite tcl-tk@8 to prevent conflict with GitHub image's version (GH-128090)

brew link --overwrite tcl-tk@8 to prevent conflict with GitHub image's version
(cherry picked from commit 46dc1ba9c6e8b95635fa27607d01d6108d8f677e)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
10 months ago[3.12] gh-126742: add NEWS entry for fix of localized error messages (GH-128025)...
Miss Islington (bot) [Thu, 19 Dec 2024 13:52:42 +0000 (14:52 +0100)] 
[3.12] gh-126742: add NEWS entry for fix of localized error messages (GH-128025) (GH-128060)

(cherry picked from commit 2610bccfdf55bc6519808f8e1b5db2cfb03ae809)

10 months ago[3.12] gh-122706: fix docs for asyncio ssl sockets (GH-128092) (#128093)
Miss Islington (bot) [Thu, 19 Dec 2024 12:55:54 +0000 (13:55 +0100)] 
[3.12] gh-122706: fix docs for asyncio ssl sockets (GH-128092) (#128093)

gh-122706: fix docs for asyncio ssl sockets (GH-128092)
(cherry picked from commit 19c5134d57764d3db7b1cacec4f090c74849a5c1)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
10 months ago[3.12] gh-126742: Avoid checking for library filename in test_ctypes (GH-128034)...
Miss Islington (bot) [Wed, 18 Dec 2024 08:45:34 +0000 (09:45 +0100)] 
[3.12] gh-126742: Avoid checking for library filename in test_ctypes (GH-128034) (#128057)

gh-126742: Avoid checking for library filename in test_ctypes (GH-128034)

Avoid checking for library filename in `dlerror()` error messages of test_ctypes.
(cherry picked from commit 335e24fb0a5805ac1ecdbc01e0331b38fc33849d)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
10 months ago[3.12] gh-126742: Add _PyErr_SetLocaleString, use it for gdbm & dlerror messages...
Bénédikt Tran [Tue, 17 Dec 2024 12:53:16 +0000 (13:53 +0100)] 
[3.12] gh-126742: Add _PyErr_SetLocaleString, use it for gdbm & dlerror messages (GH-126746) (GH-128027)

- Add a helper to set an error from locale-encoded `char*`
- Use the helper for gdbm & dlerror messages

Co-authored-by: Victor Stinner <vstinner@python.org>
10 months ago[3.12] gh-126554: ctypes: Correctly handle NULL dlsym values (GH-126555) (GH-127764)
Bénédikt Tran [Tue, 17 Dec 2024 11:53:43 +0000 (12:53 +0100)] 
[3.12] gh-126554: ctypes: Correctly handle NULL dlsym values (GH-126555) (GH-127764)

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

Signed-off-by: Georgios Alexopoulos <grgalex42@gmail.com>
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>
10 months ago[3.12] Fix typo in itertools docs (gh-127995) (gh-127997)
Miss Islington (bot) [Mon, 16 Dec 2024 17:18:15 +0000 (18:18 +0100)] 
[3.12] Fix typo in itertools docs (gh-127995) (gh-127997)

10 months ago[3.12] gh-127906: Skip limited C API test_cext tests if Py_TRACE_REFS (#127993)
Victor Stinner [Mon, 16 Dec 2024 17:15:17 +0000 (18:15 +0100)] 
[3.12] gh-127906: Skip limited C API test_cext tests if Py_TRACE_REFS (#127993)

gh-127906: Skip limited C API test_cext tests if Py_TRACE_REFS

Skip limited C API tests in test_cext and test_cppext if Python is
configured with --with-trace-refs (if the Py_TRACE_REFS macro is
defined).

10 months ago[3.12] gh-127257: ssl: Raise OSError for ERR_LIB_SYS (GH-127361) (GH-127905)
Miss Islington (bot) [Mon, 16 Dec 2024 14:43:57 +0000 (15:43 +0100)] 
[3.12] gh-127257: ssl: Raise OSError for ERR_LIB_SYS (GH-127361) (GH-127905)

gh-127257: ssl: Raise OSError for ERR_LIB_SYS (GH-127361)

From the ERR_raise manpage:

    ERR_LIB_SYS

        This "library code" indicates that a system error is
        being reported.  In this case, the reason code given
        to `ERR_raise()` and `ERR_raise_data()` *must* be
        `errno(3)`.

This PR only handles ERR_LIB_SYS for the high-lever error types
SSL_ERROR_SYSCALL and SSL_ERROR_SSL, i.e., not the ones where
OpenSSL indicates it has some more information about the issue.
(cherry picked from commit f4b31edf2d9d72878dab1f66a36913b5bcc848ec)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
10 months ago[3.12] gh-127852: add remark about ',' separator (GH-127854) (#127942)
Miss Islington (bot) [Sat, 14 Dec 2024 13:37:00 +0000 (14:37 +0100)] 
[3.12] gh-127852: add remark about ',' separator (GH-127854) (#127942)

Specify that it is valid for floats and ints with 'd' presentation and an error otherwise.
---------

(cherry picked from commit e2325c9db0650fc06d909eb2b5930c0573f24f71)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
10 months ago[3.12] gh-126937: ctypes: add test for maximum size of a struct field (GH-126938...
Petr Viktorin [Fri, 13 Dec 2024 15:51:55 +0000 (16:51 +0100)] 
[3.12] gh-126937: ctypes: add test for maximum size of a struct field (GH-126938) (GH-127825) (GH-127909)

This backports the *test* from GH-126938, with changed limit and exception class.

Co-authored-by: Melissa0x1f992 <70096546+Melissa0x1f992@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry-picked from d51c1444e36e2cfdb33087f165819a7cd6774a9e)

10 months ago[3.12] gh-127906: Test the limited C API in test_cppext (GH-127916) (#127920)
Miss Islington (bot) [Fri, 13 Dec 2024 14:14:20 +0000 (15:14 +0100)] 
[3.12] gh-127906: Test the limited C API in test_cppext (GH-127916) (#127920)

gh-127906: Test the limited C API in test_cppext (GH-127916)
(cherry picked from commit d05a4e6a0d366b854a3103cae0c941811fd48c4c)

Co-authored-by: Victor Stinner <vstinner@python.org>
10 months ago[3.12] gh-127906: Backport test_cext from the main branch (#127912)
Victor Stinner [Fri, 13 Dec 2024 13:48:32 +0000 (14:48 +0100)] 
[3.12] gh-127906: Backport test_cext from the main branch (#127912)

10 months ago[3.12] gh-127870: Detect recursive calls in ctypes _as_parameter_ handling (#127872...
Victor Stinner [Fri, 13 Dec 2024 13:21:30 +0000 (14:21 +0100)] 
[3.12] gh-127870: Detect recursive calls in ctypes _as_parameter_ handling (#127872) (#127918)

gh-127870: Detect recursive calls in ctypes _as_parameter_ handling (#127872)

(cherry picked from commit 6ff38fc4e2af8e795dc791be6ea596d2146d4119)

10 months ago[3.12] gh-127906: Backport test_cppext changes from the main branch (#127915)
Victor Stinner [Fri, 13 Dec 2024 12:51:06 +0000 (13:51 +0100)] 
[3.12] gh-127906: Backport test_cppext changes from the main branch (#127915)

10 months ago[3.12] gh-127906: Declare timeval struct in pytime.h on Windows (#127908)
Victor Stinner [Fri, 13 Dec 2024 12:13:49 +0000 (13:13 +0100)] 
[3.12] gh-127906: Declare timeval struct in pytime.h on Windows (#127908)

gh-127906: Declare timeval struct in pytime.h on Windows

Fix the following MSVC compiler warning:

    include\cpython\pytime.h(192): warning C4115: 'timeval':
    named type definition in parentheses

10 months ago[3.12] gh-107249: Implement Py_UNUSED() for MSVC (GH-107250) (#127907)
Miss Islington (bot) [Fri, 13 Dec 2024 11:58:47 +0000 (12:58 +0100)] 
[3.12] gh-107249: Implement Py_UNUSED() for MSVC (GH-107250) (#127907)

gh-107249: Implement Py_UNUSED() for MSVC (GH-107250)

Fix warnings C4100 in Py_UNUSED() when Python is built with "cl /W4".

Example with this function included by Python.h:

    static inline unsigned int
    PyUnicode_IS_READY(PyObject* Py_UNUSED(op))
    { return 1; }

Without this change, building a C program with "cl /W4" which just
includes Python.h emits the warning:

    Include\cpython/unicodeobject.h(199):
    warning C4100: '_unused_op': unreferenced formal parameter

This change fix this warning.
(cherry picked from commit 6a43cce32b66e0f66992119dd82959069b6f324a)

Co-authored-by: Victor Stinner <vstinner@python.org>
10 months ago[3.12] gh-127902: Make sure `extern "C"` is closed when using Py_LIMITED_API (#127904)
Dmitry Shachnev [Fri, 13 Dec 2024 11:18:28 +0000 (14:18 +0300)] 
[3.12] gh-127902: Make sure `extern "C"` is closed when using Py_LIMITED_API (#127904)

Fixes #127902.

10 months ago[3.12] Document PyObject_SelfIter (GH-127861) (#127899)
Miss Islington (bot) [Fri, 13 Dec 2024 09:38:19 +0000 (10:38 +0100)] 
[3.12] Document PyObject_SelfIter (GH-127861) (#127899)

Document PyObject_SelfIter (GH-127861)
(cherry picked from commit 58942a07df8811afba9c58dc16c1aab244ccf27a)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
10 months ago[3.12] link to the correct output method in documentation (GH-127857) (#127901)
Miss Islington (bot) [Fri, 13 Dec 2024 09:37:59 +0000 (10:37 +0100)] 
[3.12] link to the correct output method in documentation (GH-127857) (#127901)

link to the correct output method in documentation (GH-127857)
(cherry picked from commit 11ff3286b7e821bf439bc7caa0fa712e3bc3846a)

Co-authored-by: Viktor Kálmán <kviktor@users.noreply.github.com>
10 months ago[3.12] Fix typo in traceback docs (GH-127884) (#127891)
Miss Islington (bot) [Thu, 12 Dec 2024 21:54:23 +0000 (22:54 +0100)] 
[3.12] Fix typo in traceback docs (GH-127884) (#127891)

Co-authored-by: Daniel Haag <121057143+denialhaag@users.noreply.github.com>
10 months ago[3.12] Fix typos in `Lib/_pydecimal.py` (GH-127700) (#127888)
Miss Islington (bot) [Thu, 12 Dec 2024 20:45:20 +0000 (21:45 +0100)] 
[3.12] Fix typos in `Lib/_pydecimal.py` (GH-127700) (#127888)

Fix typos in `Lib/_pydecimal.py` (GH-127700)
(cherry picked from commit ed037d229f64db90aea00f397e9ce1b2f4a22d3f)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
10 months ago[3.12] gh-127563: use `dk_log2_index_bytes=3` in empty dicts (GH-127568) (GH-127813)
Miss Islington (bot) [Thu, 12 Dec 2024 11:50:51 +0000 (12:50 +0100)] 
[3.12] gh-127563: use `dk_log2_index_bytes=3` in empty dicts (GH-127568) (GH-127813)

This fixes a UBSan failure (unaligned zero-size memcpy) in `dictobject.c`.
(cherry picked from commit 9af96f440618304e7cc609c246e1f8c8b2d7a119)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
10 months ago[3.12] gh-123401: Fix http.cookies module to support obsolete RFC 850 date format...
Miss Islington (bot) [Wed, 11 Dec 2024 15:34:22 +0000 (16:34 +0100)] 
[3.12] gh-123401: Fix http.cookies module to support obsolete RFC 850 date format (GH-123405) (#127829)

gh-123401: Fix http.cookies module to support obsolete RFC 850 date format (GH-123405)
(cherry picked from commit 359389ed51aecc107681e600b71852c0a97304e1)

Co-authored-by: Nano <nanoapezlk@gmail.com>
Co-authored-by: Wulian <1055917385@qq.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
10 months ago[3.12] Add `extern "C"` around `PyTraceMalloc_` functions. (#127772) (#127817)
Victor Stinner [Wed, 11 Dec 2024 13:08:23 +0000 (14:08 +0100)] 
[3.12] Add `extern "C"` around `PyTraceMalloc_` functions. (#127772) (#127817)

Add `extern "C"` around `PyTraceMalloc_` functions. (#127772)

Pretty much everything else exported by Python.h has an extern "C"
annotation, yet this header appears to be missing one.

(cherry picked from commit 2cdeb61b57e638ae46a04386330a12abe9cddf2c)

Co-authored-by: Peter Hawkins <hawkinsp@cs.stanford.edu>
10 months ago[3.12] GH-117195: Avoid assertion error in `object.__sizeof__` (GH-117220) (#127605)
Miss Islington (bot) [Wed, 11 Dec 2024 11:21:07 +0000 (12:21 +0100)] 
[3.12] GH-117195: Avoid assertion error in `object.__sizeof__` (GH-117220) (#127605)

GH-117195: Avoid assertion error in `object.__sizeof__` (GH-117220)
(cherry picked from commit 406ffb5293a8c9ca315bf63de1ee36a9b33f9aaf)

Co-authored-by: Mark Shannon <mark@hotpy.org>
10 months ago[3.12] gh-111609: `end_offset` is ignored in subclasses of SyntaxError (#127554)
Nice Zombies [Wed, 11 Dec 2024 09:09:34 +0000 (10:09 +0100)] 
[3.12] gh-111609: `end_offset` is ignored in subclasses of SyntaxError (#127554)

* `end_offset` is ignored in subclasses of SyntaxError

* 📜🤖 Added by blurb_it.

* Add test

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
10 months ago[3.12] Update the documentation howto index page and group docs into 3 logical sectio...
Hugo van Kemenade [Wed, 11 Dec 2024 06:58:37 +0000 (08:58 +0200)] 
[3.12] Update the documentation howto index page and group docs into 3 logical sections (GH-119366) (#127811)

(cherry picked from commit a26d27e7ee512cd822b7a7ba075171152779ffdd)

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
10 months ago[3.12] Docs: Fix indents in `xmlrpc.client.rst` (GH-127782) (#127800)
Miss Islington (bot) [Tue, 10 Dec 2024 17:44:45 +0000 (18:44 +0100)] 
[3.12] Docs: Fix indents in `xmlrpc.client.rst` (GH-127782) (#127800)

Docs: Fix indents in `xmlrpc.client.rst` (GH-127782)
(cherry picked from commit 035f512046337e64a018d11fdaa3b21758625291)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
10 months ago[3.12] Add zizmor to pre-commit and fix most findings (GH-127749) (#127788)
Hugo van Kemenade [Tue, 10 Dec 2024 14:57:27 +0000 (16:57 +0200)] 
[3.12] Add zizmor to pre-commit and fix most findings (GH-127749) (#127788)

(cherry picked from commit ae31df354d02e12bf656954c5c72380d96c1dc0e)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
10 months ago[3.12] Add zizmor to pre-commit and fix most findings (GH-127749) (#127788)
Hugo van Kemenade [Tue, 10 Dec 2024 13:55:00 +0000 (15:55 +0200)] 
[3.12] Add zizmor to pre-commit and fix most findings (GH-127749) (#127788)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
10 months ago[3.12] gh-101100: Fix sphinx warnings in `whatsnew/3.0.rst` (GH-127662) (#127784)
Miss Islington (bot) [Tue, 10 Dec 2024 10:52:22 +0000 (11:52 +0100)] 
[3.12] gh-101100: Fix sphinx warnings in `whatsnew/3.0.rst` (GH-127662) (#127784)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
11 months ago[3.12] gh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in datetime...
Miss Islington (bot) [Tue, 10 Dec 2024 08:20:54 +0000 (09:20 +0100)] 
[3.12] gh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in datetime.strptime patterns (GH-127590) (#127649)

gh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in datetime.strptime patterns (GH-127590)

The code has required 4 digits for the year since its inclusion in the stdlib in 2002 (over 22 years ago as of this commit).
(cherry picked from commit 51cfa569e379f84b3418db0971a71b1ef575a42b)

Co-authored-by: Beomsoo Kim <beoms424@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.12] gh-126775: make linecache.checkcache threadsafe and GC re-entrency safe (GH...
Miss Islington (bot) [Tue, 10 Dec 2024 08:02:22 +0000 (09:02 +0100)] 
[3.12] gh-126775: make linecache.checkcache threadsafe and GC re-entrency safe (GH-126776) (#127779)

gh-126775: make linecache.checkcache threadsafe and GC re-entrency safe (GH-126776)

(cherry picked from commit 2233c303e476496fc4c85a29a1429a7e4b1f707b)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bartosz Sławecki <bartoszpiotrslawecki@gmail.com>
11 months agogh-127732: Add Windows Server 2025 detection to platform module (GH-127733)
Miss Islington (bot) [Mon, 9 Dec 2024 12:42:37 +0000 (13:42 +0100)] 
gh-127732: Add Windows Server 2025 detection to platform module (GH-127733)

(cherry picked from commit 5eb7fd4d0fc37b91058086181afebec41e66e5ad)

Co-authored-by: Wulian <1055917385@qq.com>
11 months ago[3.12] gh-127734: improve signature of `urllib.request.HTTPPasswordMgrWithPriorAuth...
Miss Islington (bot) [Sun, 8 Dec 2024 20:16:03 +0000 (21:16 +0100)] 
[3.12] gh-127734: improve signature of `urllib.request.HTTPPasswordMgrWithPriorAuth.__init__` (GH-127735) (#127745)

gh-127734: improve signature of `urllib.request.HTTPPasswordMgrWithPriorAuth.__init__` (GH-127735)

improve signature of urllib.request.HTTPPasswordMgrWithPriorAuth.__init__
(cherry picked from commit a03efb533a58fd13fb0cc7f4a5c02c8406a407bd)

Co-authored-by: Stephen Morton <git@tungol.org>
11 months ago[3.12] Give `poplib.POP3.rpop` a proper docstring (GH-127370) (#127722)
Miss Islington (bot) [Sat, 7 Dec 2024 16:33:04 +0000 (17:33 +0100)] 
[3.12] Give `poplib.POP3.rpop` a proper docstring (GH-127370) (#127722)

Give `poplib.POP3.rpop` a proper docstring (GH-127370)

Previously `poplib.POP3.rpop` had a "Not sure what this does" docstring, now it has been fixed.
(cherry picked from commit 27d0d2141319d82709eb09ba20065df3e1714fab)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
11 months ago[3.12] gh-101100: amend references starting with `!~` in gh-127054 (GH-127684) (...
Miss Islington (bot) [Fri, 6 Dec 2024 14:19:52 +0000 (15:19 +0100)] 
[3.12] gh-101100: amend references starting with `!~` in gh-127054 (GH-127684) (#127693)

gh-101100: amend references starting with `!~` in gh-127054 (GH-127684)
(cherry picked from commit 77a61c0465c27c1c4ba7cddf4638d9ed75259671)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
11 months ago[3.12] gh-127655: Ensure `_SelectorSocketTransport.writelines` pauses the protocol...
Miss Islington (bot) [Fri, 6 Dec 2024 05:12:40 +0000 (06:12 +0100)] 
[3.12] gh-127655: Ensure `_SelectorSocketTransport.writelines` pauses the protocol if needed (GH-127656) (#127664)

gh-127655: Ensure `_SelectorSocketTransport.writelines` pauses the protocol if needed (GH-127656)

Ensure `_SelectorSocketTransport.writelines` pauses the protocol if it reaches the high water mark as needed.
(cherry picked from commit e991ac8f2037d78140e417cc9a9486223eb3e786)

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
11 months ago[3.12] [Docs] GDB howto: Fix block type of a cast example (GH-127621) (#127654)
Miss Islington (bot) [Thu, 5 Dec 2024 21:01:23 +0000 (22:01 +0100)] 
[3.12] [Docs] GDB howto: Fix block type of a cast example (GH-127621) (#127654)

[Docs] GDB howto: Fix block type of a cast example (GH-127621)
(cherry picked from commit 657d0e99aa8754372786120d6ec00c9d9970e775)

Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
11 months ago[3.12] GH-126727: Fix test_era_nl_langinfo with Japanese ERAs on Solaris (GH-127327...
Miss Islington (bot) [Thu, 5 Dec 2024 19:01:25 +0000 (20:01 +0100)] 
[3.12] GH-126727: Fix test_era_nl_langinfo with Japanese ERAs on Solaris (GH-127327) (GH-127646)

(cherry picked from commit d958d9f4a1b71c6d30960bf6c53c41046ea94590)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
11 months ago[3.12] gh-122431: Disallow negative values in `readline.append_history_file` (GH...
Miss Islington (bot) [Thu, 5 Dec 2024 17:15:30 +0000 (18:15 +0100)] 
[3.12] gh-122431: Disallow negative values in `readline.append_history_file` (GH-122469) (#127642)

gh-122431: Disallow negative values in `readline.append_history_file` (GH-122469)
(cherry picked from commit 208b0fb645c0e14b0826c0014e74a0b70c58c9d6)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.12] gh-93312: Include <sys/pidfd.h> to get PIDFD_NONBLOCK (#127593) (#127631)
Victor Stinner [Thu, 5 Dec 2024 09:59:53 +0000 (10:59 +0100)] 
[3.12] gh-93312: Include <sys/pidfd.h> to get PIDFD_NONBLOCK (#127593) (#127631)

gh-93312: Include <sys/pidfd.h> to get PIDFD_NONBLOCK (#127593)

(cherry picked from commit fcbe6ecdb6ed4dd93b2ee144f89a73af755e2634)

11 months ago[3.12] gh-127347: Document `traceback.print_list` (GH-127348) (#127570)
Miss Islington (bot) [Wed, 4 Dec 2024 08:29:10 +0000 (09:29 +0100)] 
[3.12] gh-127347: Document `traceback.print_list` (GH-127348) (#127570)

Add an documentation entry about `traceback.print_list`

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
11 months agoPost 3.12.8
Thomas Wouters [Tue, 3 Dec 2024 21:35:54 +0000 (22:35 +0100)] 
Post 3.12.8

11 months agoPython 3.12.8 v3.12.8
Thomas Wouters [Tue, 3 Dec 2024 18:40:02 +0000 (19:40 +0100)] 
Python 3.12.8

11 months ago[3.12] gh-116510: Fix a Crash Due to Shared Immortal Interned Strings (gh-125205)
Miss Islington (bot) [Tue, 3 Dec 2024 17:26:25 +0000 (18:26 +0100)] 
[3.12] gh-116510: Fix a Crash Due to Shared Immortal Interned Strings (gh-125205)

Fix a crash caused by immortal interned strings being shared between
sub-interpreters that use basic single-phase init. In that case, the string
can be used by an interpreter that outlives the interpreter that created and
interned it. For interpreters that share obmalloc state, also share the
interned dict with the main interpreter.

This is an un-revert of gh-124646 that then addresses the Py_TRACE_REFS
failures identified by gh-124785 (i.e. backporting gh-125709 too).

(cherry picked from commit f2cb39947093feda3ff85b8dc820922cc5e5f954, AKA gh-124865)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
11 months ago[3.12] gh-126876: Fix socket internal_select() for large timeout (GH-126968) (#127003)
Miss Islington (bot) [Tue, 3 Dec 2024 14:12:59 +0000 (15:12 +0100)] 
[3.12] gh-126876: Fix socket internal_select() for large timeout (GH-126968) (#127003)

gh-126876: Fix socket internal_select() for large timeout (GH-126968)

If the timeout is larger than INT_MAX, replace it with INT_MAX, in
the poll() code path.

Add an unit test.
(cherry picked from commit b3687ad454c4ac54c8599a10f3ace8a13ca48915)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.12] gh-127253: Note that Stable ABI is about ABI stability (GH-127254) (GH-127558)
Miss Islington (bot) [Tue, 3 Dec 2024 12:57:58 +0000 (13:57 +0100)] 
[3.12] gh-127253: Note that Stable ABI is about ABI stability (GH-127254) (GH-127558)

(cherry picked from commit 35d37d6592d1be71ea76042165f6cbfa6c4c3a17)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
11 months agogh-119826: Improved fallback for ntpath.abspath() on Windows (GH-119938)
Miss Islington (bot) [Mon, 2 Dec 2024 20:03:44 +0000 (21:03 +0100)] 
gh-119826: Improved fallback for ntpath.abspath() on Windows (GH-119938)

(cherry picked from commit 4b00aba42e4d9440d22e399ec2122fe8601bbe54)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
11 months ago[3.12] gh-113841: fix possible undefined division by 0 in _Py_c_pow() (GH-127211...
Miss Islington (bot) [Mon, 2 Dec 2024 19:47:42 +0000 (20:47 +0100)] 
[3.12] gh-113841: fix possible undefined division by 0 in _Py_c_pow() (GH-127211) (GH-127216) (GH-127530)

[3.13] gh-113841: fix possible undefined division by 0 in _Py_c_pow() (GH-127211) (GH-127216)

Note, that transformed expression is not an equivalent for original one (1/exp(-x) != exp(x) in general for floating-point numbers). Though, the difference seems to be ~1ULP for good libm implementations.

It's more interesting why division was used from beginning. Closest algorithm I've found (no error checks, of course;)) - it's Algorithm 190 from ACM: https://dl.acm.org/doi/10.1145/366663.366679. It uses subtraction in the exponent.

(cherry picked from commit f7bb658124aba74be4c13f498bf46cfded710ef9)

(cherry picked from commit f41d8d89e79d634895868656f50a0e16e339f9d6)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
11 months ago[3.12] gh-126618: fix repr(itertools.count(sys.maxsize)) (GH-127048) (#127510)
Sergey B Kirpichev [Mon, 2 Dec 2024 14:19:59 +0000 (17:19 +0300)] 
[3.12] gh-126618: fix repr(itertools.count(sys.maxsize)) (GH-127048) (#127510)

(cherry picked from commit 930ba0ce605eee9e3b992fa368b00a3f2b7dc4c1)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.12] gh-126699: allow AsyncIterator to be used as a base for Protocols (GH-126702...
Miss Islington (bot) [Mon, 2 Dec 2024 14:18:53 +0000 (15:18 +0100)] 
[3.12] gh-126699: allow AsyncIterator to be used as a base for Protocols (GH-126702) (#126761)

gh-126699: allow AsyncIterator to be used as a base for Protocols (GH-126702)
(cherry picked from commit feb3e0b19cb03f06364a3f5e970f0861b8883d1c)

Co-authored-by: Stephen Morton <github@tungol.org>
11 months ago[3.12] gh-101100: Fix Sphinx warnings about list methods (GH-127054) (#127512)
Miss Islington (bot) [Mon, 2 Dec 2024 14:01:46 +0000 (15:01 +0100)] 
[3.12] gh-101100: Fix Sphinx warnings about list methods (GH-127054) (#127512)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
11 months ago[3.12] add missing gc_collect() calls in sqlite3 tests (GH-127446) (#127501)
Miss Islington (bot) [Mon, 2 Dec 2024 13:57:51 +0000 (14:57 +0100)] 
[3.12] add missing gc_collect() calls in sqlite3 tests (GH-127446) (#127501)

add missing gc_collect() calls in sqlite3 tests (GH-127446)
(cherry picked from commit 2a373da7700cf928e0a5ce3998d19351a3565df4)

Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
11 months ago[3.12] Docs: Miscellaneous corrections to simple statements in the language reference...
Carol Willing [Mon, 2 Dec 2024 13:55:31 +0000 (05:55 -0800)] 
[3.12] Docs: Miscellaneous corrections to simple statements in the language reference (GH-126720) (#126891)

* Replace: The :keyword:`global` -> The :keyword:`global` statement
Add :keyword: when it's needed

* Replace repeated links with duoble backticks
(cherry picked from commit 94a7a4e22fb8f567090514785c69e65298acca42)

Co-authored-by: Beomsoo Kim <beoms424@gmail.com>
11 months ago[3.12] gh-99880: document rounding mode for new-style formatting (GH-121481) (#126335)
Miss Islington (bot) [Mon, 2 Dec 2024 13:52:49 +0000 (14:52 +0100)] 
[3.12] gh-99880: document rounding mode for new-style formatting (GH-121481) (#126335)

The CPython uses _Py_dg_dtoa(), which does rounding to nearest with half
to even tie-breaking rule.

If that functions is unavailable, PyOS_double_to_string() fallbacks to
system snprintf().  Since CPython 3.12, build requirements include C11
compiler *and* support for IEEE 754 floating point numbers (Annex F).
This means that FE_TONEAREST macro is available and, per default,
printf-like functions should use same rounding mode as _Py_dg_dtoa().

(cherry picked from commit 7d7d56d8b1147a6b85e1c09d01b164df7c5c4942)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.12] Fix Unicode encode_wstr_utf8() (#127420) (#127504)
Bénédikt Tran [Mon, 2 Dec 2024 12:24:26 +0000 (13:24 +0100)] 
[3.12] Fix Unicode encode_wstr_utf8() (#127420) (#127504)

Fix Unicode encode_wstr_utf8() (#127420)

Raise RuntimeError instead of RuntimeWarning.

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

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.12] gh-127356: Fix prepend doctrees directory for gettext target (GH-127357) ...
Miss Islington (bot) [Sun, 1 Dec 2024 09:24:18 +0000 (10:24 +0100)] 
[3.12] gh-127356: Fix prepend doctrees directory for gettext target (GH-127357) (#127471)

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

(cherry picked from commit 33ce8dcf791721fea563715f681dc1593a35b83b)

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

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.12] Link to correct class methods in asyncio primitives docs (GH-127270) (#127438)
Bénédikt Tran [Sat, 30 Nov 2024 10:02:07 +0000 (11:02 +0100)] 
[3.12] Link to correct class methods in asyncio primitives docs (GH-127270) (#127438)

11 months ago[3.12] gh-88110: Clear concurrent.futures.thread._threads_queues after fork to avoid...
Miss Islington (bot) [Sat, 30 Nov 2024 09:05:46 +0000 (10:05 +0100)] 
[3.12] gh-88110: Clear concurrent.futures.thread._threads_queues after fork to avoid joining parent process' threads (GH-126098) (GH-127164)

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.12] gh-127208: Reject null character in _imp.create_dynamic() (#127400) (#127419)
Victor Stinner [Fri, 29 Nov 2024 16:03:24 +0000 (17:03 +0100)] 
[3.12] gh-127208: Reject null character in _imp.create_dynamic() (#127400) (#127419)

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

_imp.create_dynamic() now rejects embedded null characters in the
path and in the module name.

Backport also the _PyUnicode_AsUTF8NoNUL() function.

(cherry picked from commit b14fdadc6c620875a20b7ccc3c9b069e85d8557a)

11 months ago[3.12] gh-127359: Pin Tcl/Tk to 8 (8.6) for testing macOS (GH-127365) (#127394)
Hugo van Kemenade [Fri, 29 Nov 2024 11:02:41 +0000 (13:02 +0200)] 
[3.12] gh-127359: Pin Tcl/Tk to 8 (8.6) for testing macOS (GH-127365) (#127394)

11 months ago[3.12] gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (GH-127358)...
Miss Islington (bot) [Fri, 29 Nov 2024 10:59:22 +0000 (11:59 +0100)] 
[3.12] gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (GH-127358) (#127402)

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.12] gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304) (#127391)
Miss Islington (bot) [Fri, 29 Nov 2024 09:22:27 +0000 (10:22 +0100)] 
[3.12] gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304) (#127391)

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.12] gh-127190: Fix local_setattro() error handling (GH-127366) (#127368)
Miss Islington (bot) [Thu, 28 Nov 2024 17:32:50 +0000 (18:32 +0100)] 
[3.12] gh-127190: Fix local_setattro() error handling (GH-127366) (#127368)

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.12] gh-123967: Fix faulthandler for trampoline frames (#127329) (#127363)
Victor Stinner [Thu, 28 Nov 2024 13:57:35 +0000 (14:57 +0100)] 
[3.12] gh-123967: Fix faulthandler for trampoline frames (#127329) (#127363)

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

If the top-most frame is a trampoline frame, skip it.

(cherry picked from commit 58e334e1431b2ed6b70ee42501ea73e08084e769)

11 months ago[3.12] gh-124008: Fix calculation of the number of written bytes for the Windows...
Miss Islington (bot) [Wed, 27 Nov 2024 14:00:30 +0000 (15:00 +0100)] 
[3.12] gh-124008: Fix calculation of the number of written bytes for the Windows console (GH-124059) (GH-127326)

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.12] gh-109746: Fix race condition in test_start_new_thread_failed (GH-127299)...
Miss Islington (bot) [Wed, 27 Nov 2024 12:22:32 +0000 (13:22 +0100)] 
[3.12] gh-109746: Fix race condition in test_start_new_thread_failed (GH-127299) (GH-127324)

(cherry picked from commit 83926d3b4c7847394b5e2531e9566d7fc9fbea0f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.12] gh-101100: Fix sphinx warnings in `howto/*` (GH-127084) (#127311)
Yuki Kobayashi [Wed, 27 Nov 2024 09:46:42 +0000 (18:46 +0900)] 
[3.12] gh-101100: Fix sphinx warnings in `howto/*` (GH-127084) (#127311)

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

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.12] gh-127265: Remove single quotes from 'arrow's in tutorial/errors.rst (GH-127268)
Miss Islington (bot) [Mon, 25 Nov 2024 21:42:34 +0000 (22:42 +0100)] 
[3.12] gh-127265: Remove single quotes from 'arrow's in tutorial/errors.rst (GH-127268)

(cherry picked from commit 26ff32b30553e1f7b0cc822835ad2da8890c180c)

Co-authored-by: funkyrailroad <funkyrailroad@users.noreply.github.com>
11 months ago[3.12] Fix a few typos found in the docs (GH-127126) (GH-127185)
Rafael Fontenelle [Mon, 25 Nov 2024 19:48:00 +0000 (16:48 -0300)] 
[3.12] Fix a few typos found in the docs (GH-127126) (GH-127185)

(cherry picked from commit 39e60aeb3837f1f23d8b7f30d3b8d9faf805ef88)

11 months ago[3.12] gh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the first value...
Miss Islington (bot) [Mon, 25 Nov 2024 17:51:21 +0000 (18:51 +0100)] 
[3.12] gh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the first value (GH-127219) (#127263)

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.12] gh-126384: Add tests to verify the behavior of basic COM methods. (GH-126610...
Miss Islington (bot) [Mon, 25 Nov 2024 12:18:35 +0000 (13:18 +0100)] 
[3.12] gh-126384: Add tests to verify the behavior of basic COM methods. (GH-126610) (GH-127160)

(cherry picked from commit 7725c0371a93be3ccfaff4871014a80bdf0ea274)

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

11 months ago[3.12] gh-127217: Fix pathname2url() for paths starting with multiple slashes on...
Miss Islington (bot) [Sun, 24 Nov 2024 18:13:23 +0000 (19:13 +0100)] 
[3.12] gh-127217: Fix pathname2url() for paths starting with multiple slashes on Posix (GH-127218) (GH-127231)

(cherry picked from commit 97b2ceaaaf88a73a45254912a0e972412879ccbf)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.12] Improve `pathname2url()` and `url2pathname()` docs (GH-127125) (#127233)
Miss Islington (bot) [Sun, 24 Nov 2024 17:48:12 +0000 (18:48 +0100)] 
[3.12] Improve `pathname2url()` and `url2pathname()` docs (GH-127125) (#127233)

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>