]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
11 months agogh-127253: Note that Stable ABI is about ABI stability (GH-127254)
Petr Viktorin [Tue, 3 Dec 2024 12:30:27 +0000 (13:30 +0100)] 
gh-127253: Note that Stable ABI is about ABI stability (GH-127254)

11 months agodocs(logging): fix phrasing from "operation on" to "operate on" (#127543)
Alexander Stepchenko [Tue, 3 Dec 2024 06:52:12 +0000 (09:52 +0300)] 
docs(logging): fix phrasing from "operation on" to "operate on" (#127543)

11 months agoSpeed-up lazy heapq import in collections (gh-127538)
Raymond Hettinger [Tue, 3 Dec 2024 02:45:36 +0000 (20:45 -0600)] 
Speed-up lazy heapq import in collections (gh-127538)

11 months agogh-127111: Emscripten Make web example work again (#127113)
Hood Chatham [Mon, 2 Dec 2024 23:30:24 +0000 (00:30 +0100)] 
gh-127111: Emscripten Make web example work again (#127113)

Moves the Emscripten web example into a standalone folder, and updates
Makefile targets to build the web example. Instructions for usage have
also been added.

11 months agogh-127518: Fix pystats build after #127169 (#127526)
Michael Droettboom [Mon, 2 Dec 2024 20:17:08 +0000 (15:17 -0500)] 
gh-127518: Fix pystats build after #127169 (#127526)

gh-127518: Fix pystats build after #127619

11 months agogh-127521: Mark list as "shared" before resizing if necessary (#127524)
Sam Gross [Mon, 2 Dec 2024 19:38:26 +0000 (19:38 +0000)] 
gh-127521: Mark list as "shared" before resizing if necessary (#127524)

In the free threading build, if a non-owning thread resizes a list,
it must use QSBR to free the old list array because there may be a
concurrent access (without a lock) from the owning thread.

To match the pattern in dictobject.c, we just mark the list as "shared"
before resizing if it's from a non-owning thread and not already marked
as shared.

11 months agogh-127411: Fix invalid conversion of load of TLBC array when compiled in C++ (#127466)
mpage [Mon, 2 Dec 2024 18:13:30 +0000 (10:13 -0800)] 
gh-127411: Fix invalid conversion of load of TLBC array when compiled in C++ (#127466)

Cast the result of the load to the correct type

11 months agogh-126876: Fix test_socket.testLargeTimeout() for missing _testcapi (#127517)
Victor Stinner [Mon, 2 Dec 2024 15:51:50 +0000 (16:51 +0100)] 
gh-126876: Fix test_socket.testLargeTimeout() for missing _testcapi (#127517)

11 months agogh-115999: Use light-weight lock for UNPACK_SEQUENCE_LIST (gh-127514)
Donghee Na [Mon, 2 Dec 2024 15:14:40 +0000 (00:14 +0900)] 
gh-115999: Use light-weight lock for UNPACK_SEQUENCE_LIST (gh-127514)

11 months agogh-101100: Fix Sphinx warnings about list methods (#127054)
Yuki Kobayashi [Mon, 2 Dec 2024 13:51:35 +0000 (22:51 +0900)] 
gh-101100: Fix Sphinx warnings about list methods (#127054)

11 months agogh-109523: Raise a BlockingIOError if reading text from a non-blocking stream cannot...
Giovanni Siragusa [Mon, 2 Dec 2024 13:18:30 +0000 (14:18 +0100)] 
gh-109523: Raise a BlockingIOError if reading text from a non-blocking stream cannot immediately return bytes. (GH-122933)

11 months agogh-126618: fix repr(itertools.count(sys.maxsize)) (#127048)
Sergey B Kirpichev [Mon, 2 Dec 2024 13:14:40 +0000 (16:14 +0300)] 
gh-126618: fix repr(itertools.count(sys.maxsize)) (#127048)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months agogh-126890: Restore stripped `ssl` docstrings (GH-127281)
Peter Bierma [Mon, 2 Dec 2024 12:50:34 +0000 (07:50 -0500)] 
gh-126890: Restore stripped `ssl` docstrings (GH-127281)

11 months agoFix Unicode encode_wstr_utf8() (#127420)
Victor Stinner [Mon, 2 Dec 2024 10:14:47 +0000 (11:14 +0100)] 
Fix Unicode encode_wstr_utf8() (#127420)

Raise RuntimeError instead of RuntimeWarning.

11 months agoGH-126491: GC: Mark objects reachable from roots before doing cycle collection (GH...
Mark Shannon [Mon, 2 Dec 2024 10:12:17 +0000 (10:12 +0000)] 
GH-126491: GC: Mark objects reachable from roots before doing cycle collection (GH-127110)

* Mark almost all reachable objects before doing collection phase

* Add stats for objects marked

* Visit new frames before each increment

* Update docs

* Clearer calculation of work to do.

11 months agoadd missing gc_collect() calls in sqlite3 tests (#127446)
CF Bolz-Tereick [Mon, 2 Dec 2024 10:11:28 +0000 (11:11 +0100)] 
add missing gc_collect() calls in sqlite3 tests (#127446)

11 months agogh-127443: Fix some entries in `Doc/data/refcounts.dat` (#127451)
Bénédikt Tran [Mon, 2 Dec 2024 08:21:00 +0000 (09:21 +0100)] 
gh-127443: Fix some entries in `Doc/data/refcounts.dat` (#127451)

Fix incorrect entries in `Doc/data/refcounts.dat`

11 months agoGH-127429: fix sysconfig data generation on cross-builds (#127430)
Filipe Laíns 🇵🇸 [Mon, 2 Dec 2024 07:12:36 +0000 (07:12 +0000)] 
GH-127429: fix sysconfig data generation on cross-builds (#127430)

11 months agogh-115999: Add partial free-thread specialization for BINARY_SUBSCR (gh-127227)
Donghee Na [Mon, 2 Dec 2024 01:38:17 +0000 (10:38 +0900)] 
gh-115999: Add partial free-thread specialization for BINARY_SUBSCR (gh-127227)

11 months agogh-126899: Add `**kw` to `tkinter.Misc.after` and `tkinter.Misc.after_idle` (#126900)
Zhikang Yan [Sun, 1 Dec 2024 19:29:27 +0000 (03:29 +0800)] 
gh-126899: Add `**kw` to `tkinter.Misc.after` and `tkinter.Misc.after_idle` (#126900)

---------
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months agogh-119786: cleanup internal docs and fix internal links (#127485)
Bénédikt Tran [Sun, 1 Dec 2024 17:12:22 +0000 (18:12 +0100)] 
gh-119786: cleanup internal docs and fix internal links (#127485)

11 months agogh-127321: Avoid stopping at an opcode without an associated line number for breakpoi...
Tian Gao [Sun, 1 Dec 2024 16:57:03 +0000 (08:57 -0800)] 
gh-127321: Avoid stopping at an opcode without an associated line number for breakpoint() (#127457)

11 months agogh-127356: Fix prepend doctrees directory for gettext target (#127357)
Rafael Fontenelle [Sun, 1 Dec 2024 09:15:44 +0000 (06:15 -0300)] 
gh-127356: Fix prepend doctrees directory for gettext target (#127357)

11 months agoAdd the missing `f` on an f-string error message in multiprocessing. (GH-127462)
Gregory P. Smith [Sun, 1 Dec 2024 06:44:43 +0000 (22:44 -0800)] 
Add the missing `f` on an f-string error message in multiprocessing. (GH-127462)

11 months agogh-127165: Disallow embedded NULL characters in `_interpreters` (#127199)
Peter Bierma [Sun, 1 Dec 2024 06:33:23 +0000 (01:33 -0500)] 
gh-127165: Disallow embedded NULL characters in `_interpreters` (#127199)

11 months agoGH-127381: pathlib ABCs: remove `PathBase.cwd()` and `home()` (#127427)
Barney Gale [Sat, 30 Nov 2024 18:39:39 +0000 (18:39 +0000)] 
GH-127381: pathlib ABCs: remove `PathBase.cwd()` and `home()` (#127427)

These classmethods presume that the user has retained the original
`__init__()` signature, which may not be the case. Also, many virtual
filesystems don't provide current or home directories.

11 months agosummarize: Fix typo in stats (#127450)
alm [Sat, 30 Nov 2024 16:07:54 +0000 (18:07 +0200)] 
summarize: Fix typo in stats (#127450)

11 months agoDocs: Fix incorrect indents in `c-api/type.rst` (#127449)
Yuki Kobayashi [Sat, 30 Nov 2024 15:01:15 +0000 (00:01 +0900)] 
Docs: Fix incorrect indents in `c-api/type.rst` (#127449)

11 months agogh-127417: fix UTF-8 decoder optimization on AIX (#127433)
Inada Naoki [Sat, 30 Nov 2024 12:52:37 +0000 (21:52 +0900)] 
gh-127417: fix UTF-8 decoder optimization on AIX (#127433)

11 months agogh-119786: improve internal docs on `co_linetable` (#123198)
Bénédikt Tran [Sat, 30 Nov 2024 00:25:55 +0000 (01:25 +0100)] 
gh-119786: improve internal docs on `co_linetable` (#123198)

11 months agoGH-127381: pathlib ABCs: remove `PathBase.lstat()` (#127382)
Barney Gale [Fri, 29 Nov 2024 21:03:39 +0000 (21:03 +0000)] 
GH-127381: pathlib ABCs: remove `PathBase.lstat()` (#127382)

Remove the `PathBase.lstat()` method, which is a trivial variation of
`stat()`.

No user-facing changes because the pathlib ABCs are still private.

11 months agoLink to correct class methods in asyncio primitives docs (#127270)
Ollanta Cuba Gyllensten [Fri, 29 Nov 2024 16:20:40 +0000 (17:20 +0100)] 
Link to correct class methods in asyncio primitives docs (#127270)

11 months agogh-127316: fix incorrect assertion in setting `__class__` in free-threading (#127399)
Kumar Aditya [Fri, 29 Nov 2024 16:14:20 +0000 (21:44 +0530)] 
gh-127316: fix incorrect assertion in setting `__class__` in free-threading (#127399)

11 months agogh-127208: Reject null character in _imp.create_dynamic() (#127400)
Victor Stinner [Fri, 29 Nov 2024 15:20:38 +0000 (16:20 +0100)] 
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.

11 months agofix param type in PyObject_HasAttrWithError (docs) (#127403)
biggus-developerus [Fri, 29 Nov 2024 10:53:34 +0000 (14:53 +0400)] 
fix param type in PyObject_HasAttrWithError (docs) (#127403)

11 months agogh-126024: optimize UTF-8 decoder for short non-ASCII string (#126025)
Inada Naoki [Fri, 29 Nov 2024 10:48:02 +0000 (19:48 +0900)] 
gh-126024: optimize UTF-8 decoder for short non-ASCII string (#126025)

11 months agogh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (#127358)
Victor Stinner [Fri, 29 Nov 2024 10:39:54 +0000 (11:39 +0100)] 
gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (#127358)

Replace the sleep(2) with a task which is blocked forever.

11 months agogh-127341: Argument Clinic: fix compiler warnings for getters with docstrings (#127310)
Peter Bierma [Fri, 29 Nov 2024 10:12:13 +0000 (05:12 -0500)] 
gh-127341: Argument Clinic: fix compiler warnings for getters with docstrings (#127310)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
11 months agogh-126881: fix finalization of dtoa state (#126904)
Kumar Aditya [Fri, 29 Nov 2024 09:47:16 +0000 (15:17 +0530)] 
gh-126881: fix finalization of dtoa state (#126904)

11 months agogh-127303: Add docs for token.EXACT_TOKEN_TYPES (#127304)
Илья Любавский [Fri, 29 Nov 2024 09:00:50 +0000 (12:00 +0300)] 
gh-127303: Add docs for token.EXACT_TOKEN_TYPES (#127304)

---------

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 agogh-127359: Pin Tcl/Tk to 8 (8.6) for testing macOS (#127365)
Hugo van Kemenade [Thu, 28 Nov 2024 17:03:09 +0000 (19:03 +0200)] 
gh-127359: Pin Tcl/Tk to 8 (8.6) for testing macOS (#127365)

11 months agogh-127190: Fix local_setattro() error handling (#127366)
Victor Stinner [Thu, 28 Nov 2024 16:35:48 +0000 (17:35 +0100)] 
gh-127190: Fix local_setattro() error handling (#127366)

Don't make the assumption that the 'name' argument is a string. Use
repr() to format the 'name' argument instead.

11 months agoTouch up docs for ctypes.FormatError & WinError (GH-127210)
Jun Komoda [Thu, 28 Nov 2024 15:59:47 +0000 (00:59 +0900)] 
Touch up docs for ctypes.FormatError & WinError (GH-127210)

Reformat paragraphs, add backquotes, and directives.

11 months agogh-127330: Update for OpenSSL 3.4 & document+improve the update process (GH-127331)
Petr Viktorin [Thu, 28 Nov 2024 12:29:27 +0000 (13:29 +0100)] 
gh-127330: Update for OpenSSL 3.4 & document+improve the update process (GH-127331)

- Add `git describe` output to headers generated by `make_ssl_data.py`

  This info is more important than the date when the file was generated.
  It does mean that the tool now requires a Git checkout of OpenSSL,
  not for example a release tarball.

- Regenerate the older file to add the info.
  To the other older file, add a note about manual edits.

- Add notes on how to add a new OpenSSL version

- Add 3.4 error messages and multissl tests

11 months agoGH-127178: install a _sysconfig_vars_(...).json file in the stdlib directory (#127302)
Filipe Laíns 🇵🇸 [Wed, 27 Nov 2024 23:32:54 +0000 (23:32 +0000)] 
GH-127178: install a _sysconfig_vars_(...).json file in the stdlib directory (#127302)

11 months agoGH-127154: Remove PGO and unknown-linux-gnu/clang from JIT CI (#127212)
Savannah Ostrowski [Wed, 27 Nov 2024 22:36:36 +0000 (14:36 -0800)] 
GH-127154: Remove PGO and unknown-linux-gnu/clang from JIT CI (#127212)

11 months agogh-122288: Improve performances of `fnmatch.translate` (#122289)
Bénédikt Tran [Wed, 27 Nov 2024 16:42:45 +0000 (17:42 +0100)] 
gh-122288: Improve performances of `fnmatch.translate` (#122289)

Improve performance of this function by a factor of 1.7x.

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months agogh-126882: Fix indentation in code sample block (#126887)
Topher Fischer [Wed, 27 Nov 2024 15:24:45 +0000 (07:24 -0800)] 
gh-126882: Fix indentation in code sample block (#126887)

11 months agogh-123967: Fix faulthandler for trampoline frames (#127329)
Victor Stinner [Wed, 27 Nov 2024 15:14:49 +0000 (16:14 +0100)] 
gh-123967: Fix faulthandler for trampoline frames (#127329)

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

11 months agoFix indentation for contextlib.asynccontextmanager docs (#127333)
Jelle Zijlstra [Wed, 27 Nov 2024 14:38:55 +0000 (06:38 -0800)] 
Fix indentation for contextlib.asynccontextmanager docs (#127333)

11 months agogh-124008: Fix calculation of the number of written bytes for the Windows console...
Serhiy Storchaka [Wed, 27 Nov 2024 11:38:12 +0000 (13:38 +0200)] 
gh-124008: Fix calculation of the number of written bytes for the Windows console (GH-124059)

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.

11 months agogh-109746: Fix race condition in test_start_new_thread_failed (GH-127299)
Serhiy Storchaka [Wed, 27 Nov 2024 11:29:50 +0000 (13:29 +0200)] 
gh-109746: Fix race condition in test_start_new_thread_failed (GH-127299)

11 months agogh-127072: Remove outdated `socket.NETLINK_*` constants. (GH-127256)
RUANG (James Roy) [Wed, 27 Nov 2024 06:53:41 +0000 (14:53 +0800)] 
gh-127072: Remove outdated `socket.NETLINK_*` constants. (GH-127256)

Remove seriously outdated netlink constants.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
11 months agogh-115999: Add free-threaded specialization for `STORE_SUBSCR` (#127169)
Sam Gross [Tue, 26 Nov 2024 21:46:06 +0000 (21:46 +0000)] 
gh-115999: Add free-threaded specialization for `STORE_SUBSCR` (#127169)

The specialization only depends on the type, so no special thread-safety
considerations there.

STORE_SUBSCR_LIST_INT needs to lock the list before modifying it.

`_PyDict_SetItem_Take2` already internally locks the dictionary using a
critical section.

11 months agogh-69639: Add mixed-mode rules for complex arithmetic (C-like) (GH-124829)
Sergey B Kirpichev [Tue, 26 Nov 2024 18:20:37 +0000 (21:20 +0300)] 
gh-69639: Add mixed-mode rules for complex arithmetic (C-like) (GH-124829)

"Generally, mixed-mode arithmetic combining real and complex variables should
be performed directly, not by first coercing the real to complex, lest the sign
of zero be rendered uninformative; the same goes for combinations of pure
imaginary quantities with complex variables." (c) Kahan, W: Branch cuts for
complex elementary functions.

This patch implements mixed-mode arithmetic rules, combining real and
complex variables as specified by C standards since C99 (in particular,
there is no special version for the true division with real lhs
operand).  Most C compilers implementing C99+ Annex G have only these
special rules (without support for imaginary type, which is going to be
deprecated in C2y).

11 months agogh-127285: Update PCbuild files for a number of missed changes (GH-127286)
Sergey Muraviov [Tue, 26 Nov 2024 16:39:33 +0000 (19:39 +0300)] 
gh-127285: Update PCbuild files for a number of missed changes (GH-127286)

11 months agogh-69639: Add mixed-mode rules for complex arithmetic (C-like) (GH-124829)
Sergey B Kirpichev [Tue, 26 Nov 2024 15:57:39 +0000 (18:57 +0300)] 
gh-69639: Add mixed-mode rules for complex arithmetic (C-like) (GH-124829)

"Generally, mixed-mode arithmetic combining real and complex variables should
be performed directly, not by first coercing the real to complex, lest the sign
of zero be rendered uninformative; the same goes for combinations of pure
imaginary quantities with complex variables." (c) Kahan, W: Branch cuts for
complex elementary functions.

This patch implements mixed-mode arithmetic rules, combining real and
complex variables as specified by C standards since C99 (in particular,
there is no special version for the true division with real lhs
operand).  Most C compilers implementing C99+ Annex G have only these
special rules (without support for imaginary type, which is going to be
deprecated in C2y).

11 months agogh-119180: Add VALUE_WITH_FAKE_GLOBALS format to annotationlib (#124415)
Jelle Zijlstra [Tue, 26 Nov 2024 15:40:13 +0000 (07:40 -0800)] 
gh-119180: Add VALUE_WITH_FAKE_GLOBALS format to annotationlib (#124415)

11 months agoGH-126985: move pyvenv.cfg detection from site to getpath (#126987)
Filipe Laíns 🇵🇸 [Tue, 26 Nov 2024 13:46:33 +0000 (13:46 +0000)] 
GH-126985: move pyvenv.cfg detection from site to getpath (#126987)

11 months agoDoc: Typo fix: nrace -> race (#127288)
Richard Hansen [Tue, 26 Nov 2024 13:05:07 +0000 (08:05 -0500)] 
Doc: Typo fix: nrace -> race (#127288)

11 months agogh-113993: InternalDocs: Add String Interning to README (#127250)
Petr Viktorin [Tue, 26 Nov 2024 10:06:57 +0000 (11:06 +0100)] 
gh-113993: InternalDocs: Add String Interning to README (#127250)

11 months agogh-124873: Skip timerfd tests on Android (#127279)
Malcolm Smith [Tue, 26 Nov 2024 09:46:46 +0000 (09:46 +0000)] 
gh-124873: Skip timerfd tests on Android (#127279)

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

This reverts commit c09366b1fed2289530581505834b2b262120a7c7.

* Skip timerfd tests on Android.

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months agogh-122273: Support PyREPL history on Windows (#127141)
Victor Stinner [Tue, 26 Nov 2024 09:21:57 +0000 (10:21 +0100)] 
gh-122273: Support PyREPL history on Windows (#127141)

Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
11 months agogh-126946: Improve error message in getopt.do_longs based on existing comment (GH...
Beomsoo Kim [Tue, 26 Nov 2024 08:54:02 +0000 (17:54 +0900)] 
gh-126946: Improve error message in getopt.do_longs based on existing comment (GH-126871)

Include a list of possibilities for not unique prefix.

11 months agogh-101100: Fix sphinx warnings in `howto/*` (#127084)
Yuki Kobayashi [Tue, 26 Nov 2024 08:17:54 +0000 (17:17 +0900)] 
gh-101100: Fix sphinx warnings in `howto/*` (#127084)

11 months agoFix typo: Use AsyncFor element access in codegen (#127278)
Marc Mueller [Tue, 26 Nov 2024 01:00:46 +0000 (02:00 +0100)] 
Fix typo: Use AsyncFor element access in codegen (#127278)

Use AsyncFor element access in codegen

11 months agogh-126612: Include stack effects of uops when computing maximum stack depth (#126894)
mpage [Tue, 26 Nov 2024 00:53:49 +0000 (16:53 -0800)] 
gh-126612: Include stack effects of uops when computing maximum stack depth (#126894)

11 months agogh-127265: Remove single quotes from 'arrow's in tutorial/errors.rst (GH-127267)
funkyrailroad [Mon, 25 Nov 2024 21:34:01 +0000 (16:34 -0500)] 
gh-127265: Remove single quotes from 'arrow's in tutorial/errors.rst (GH-127267)

11 months agoGH-127236: `pathname2url()`: generate RFC 1738 URL for absolute POSIX path (#127194)
Barney Gale [Mon, 25 Nov 2024 19:59:20 +0000 (19:59 +0000)] 
GH-127236: `pathname2url()`: generate RFC 1738 URL for absolute POSIX path (#127194)

When handed an absolute Windows path such as `C:\foo` or `//server/share`,
the `urllib.request.pathname2url()` function returns a URL with an
authority section, such as `///C:/foo` or `//server/share` (or before
GH-126205, `////server/share`). Only the `file:` prefix is omitted.

But when handed an absolute POSIX path such as `/etc/hosts`, or a Windows
path of the same form (rooted but lacking a drive), the function returns a
URL without an authority section, such as `/etc/hosts`.

This patch corrects the discrepancy by adding a `//` prefix before
drive-less, rooted paths when generating URLs.

11 months agogh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the first value (...
sobolevn [Mon, 25 Nov 2024 17:32:02 +0000 (20:32 +0300)] 
gh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the first value (#127219)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months agogh-127022: Remove `_PyEvalFramePushAndInit_UnTagged` (gh-127168)
Sam Gross [Mon, 25 Nov 2024 17:24:37 +0000 (17:24 +0000)] 
gh-127022: Remove `_PyEvalFramePushAndInit_UnTagged` (gh-127168)

The interpreter now handles `_PyStackRef`s pointing to immortal objects
without the deferred bit set, so `_PyEvalFramePushAndInit_UnTagged` is
no longer necessary.

11 months agogh-127248: Fix several removed or misnamed files in pythoncore.vcxproj (GH-127249)
Sergey Muraviov [Mon, 25 Nov 2024 14:56:46 +0000 (17:56 +0300)] 
gh-127248: Fix several removed or misnamed files in pythoncore.vcxproj (GH-127249)

11 months agogh-107954: Document PEP 741 in What's New 3.14 (#127056)
Victor Stinner [Mon, 25 Nov 2024 14:24:33 +0000 (15:24 +0100)] 
gh-107954: Document PEP 741 in What's New 3.14 (#127056)

11 months agogh-127183: Add `_ctypes.CopyComPointer` tests (GH-127184)
Jun Komoda [Mon, 25 Nov 2024 13:55:07 +0000 (22:55 +0900)] 
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.

11 months agoReplace `:platform:` with `.. availability::` in `socket.ioctl` doc. (GH-127122)
Jun Komoda [Mon, 25 Nov 2024 12:53:17 +0000 (21:53 +0900)] 
Replace `:platform:` with `.. availability::` in `socket.ioctl` doc. (GH-127122)

In `socket.ioctl`, `:platform:` -> `.. availability::`

11 months agogh-127238: adjust error message for sys.set_int_max_str_digits() (#127241)
Sergey B Kirpichev [Mon, 25 Nov 2024 05:29:55 +0000 (08:29 +0300)] 
gh-127238: adjust error message for sys.set_int_max_str_digits() (#127241)

Now it's correct and closer to Python/initconfig.c

11 months agoGH-115869: Make jit_stencils.h reproducible (GH-127166)
Brandt Bucher [Sun, 24 Nov 2024 22:42:50 +0000 (14:42 -0800)] 
GH-115869: Make jit_stencils.h reproducible (GH-127166)

11 months agoImprove `pathname2url()` and `url2pathname()` docs (#127125)
Barney Gale [Sun, 24 Nov 2024 17:33:46 +0000 (17:33 +0000)] 
Improve `pathname2url()` and `url2pathname()` docs (#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.

11 months agogh-127217: Fix pathname2url() for paths starting with multiple slashes on Posix ...
Serhiy Storchaka [Sun, 24 Nov 2024 17:30:29 +0000 (19:30 +0200)] 
gh-127217: Fix pathname2url() for paths starting with multiple slashes on Posix (GH-127218)

11 months agoFix macro expansions in critical section docs (#127226)
da-woods [Sun, 24 Nov 2024 17:21:02 +0000 (17:21 +0000)] 
Fix macro expansions in critical section docs (#127226)

11 months agogh-122356: restore the position of a file-like object after `zipfile.is_zipfile`...
Bénédikt Tran [Sun, 24 Nov 2024 16:36:15 +0000 (17:36 +0100)] 
gh-122356: restore the position of a file-like object after `zipfile.is_zipfile` (#122397)

11 months agogh-101100: Fix sphinx warnings of removed opcodes (#127222)
Yuki Kobayashi [Sun, 24 Nov 2024 15:43:25 +0000 (00:43 +0900)] 
gh-101100: Fix sphinx warnings of removed opcodes (#127222)

11 months agoGH-127133: Remove ability to nest argument groups & mutually exclusive groups (#127186)
Savannah Ostrowski [Sun, 24 Nov 2024 15:20:37 +0000 (07:20 -0800)] 
GH-127133: Remove ability to nest argument groups & mutually exclusive groups (#127186)

11 months agogh-113841: fix possible undefined division by 0 in _Py_c_pow() (GH-127211)
Sergey B Kirpichev [Sun, 24 Nov 2024 07:37:37 +0000 (10:37 +0300)] 
gh-113841: fix possible undefined division by 0 in _Py_c_pow() (GH-127211)

`x**y == 1/x**-y ` thus changing `/=` to `*=` by negating the exponent.

11 months agogh-126662: harmonize naming for three namedtuple base classes in urllib.parse (GH...
Stephen Morton [Sun, 24 Nov 2024 02:36:48 +0000 (18:36 -0800)] 
gh-126662: harmonize naming for three namedtuple base classes in urllib.parse (GH-126663)

harmonize naming for three namedtuple base classes in urllib.parse

11 months agopathlib tests: move `walk()` tests into their own classes (GH-126651)
Barney Gale [Sun, 24 Nov 2024 02:31:00 +0000 (02:31 +0000)] 
pathlib tests: move `walk()` tests into their own classes (GH-126651)

Move tests for Path.walk() into a new PathWalkTest class, and apply a similar change in tests for the ABCs. This allows us to properly tear down the walk test hierarchy in tearDown(), rather than leaving it to os_helper.rmtree().

11 months agoFix "useable" typo in docs (#127200)
Stan U. [Sat, 23 Nov 2024 21:41:01 +0000 (21:41 +0000)] 
Fix "useable" typo in docs (#127200)

Fix typo in docs

11 months agoDoc: C API: Fix `Py_NewInterpreterFromConfig` example code (#126667)
Richard Hansen [Sat, 23 Nov 2024 19:47:08 +0000 (14:47 -0500)] 
Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (#126667)

11 months agoGH-125866: Preserve Windows drive letter case in file URIs (#127138)
Barney Gale [Sat, 23 Nov 2024 10:41:39 +0000 (10:41 +0000)] 
GH-125866: Preserve Windows drive letter case in file URIs (#127138)

Stop converting Windows drive letters to uppercase in
`urllib.request.pathname2url()` and `url2pathname()`. This behaviour is
unnecessary and inconsistent with pathlib's file URI implementation.

11 months agoGH-127134: Add note about forward compatibility for suggest_on_error (#127137)
Savannah Ostrowski [Sat, 23 Nov 2024 03:18:18 +0000 (19:18 -0800)] 
GH-127134: Add note about forward compatibility for suggest_on_error (#127137)

11 months agoFix a few typos found in the docs (GH-127126)
Rafael Fontenelle [Sat, 23 Nov 2024 00:02:51 +0000 (21:02 -0300)] 
Fix a few typos found in the docs (GH-127126)

11 months agogh-115999: Record success in `specialize` (#127167)
mpage [Fri, 22 Nov 2024 20:07:05 +0000 (12:07 -0800)] 
gh-115999: Record success in `specialize` (#127167)

Record success in `specialize`

This matches the existing behavior where we increment the success
stat for the generic opcode each time we successfully specialize
an instruction.

11 months agogh-119786: add code object doc, inline locations.md into it (#126832)
Irit Katriel [Fri, 22 Nov 2024 19:27:41 +0000 (19:27 +0000)] 
gh-119786: add code object doc, inline locations.md into it (#126832)

11 months agogh-109746: Make _thread.start_new_thread delete state of new thread on its startup...
Radislav Chugunov [Fri, 22 Nov 2024 19:20:07 +0000 (22:20 +0300)] 
gh-109746: Make _thread.start_new_thread delete state of new thread on its startup failure (GH-109761)

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.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months agoGH-89435: os.path should not be a frozen module (#126924)
Filipe Laíns 🇵🇸 [Fri, 22 Nov 2024 18:50:30 +0000 (18:50 +0000)] 
GH-89435: os.path should not be a frozen module (#126924)

11 months agogh-127022: Simplify `PyStackRef_FromPyObjectSteal` (#127024)
Sam Gross [Fri, 22 Nov 2024 17:55:33 +0000 (17:55 +0000)] 
gh-127022: Simplify `PyStackRef_FromPyObjectSteal` (#127024)

This gets rid of the immortal check in `PyStackRef_FromPyObjectSteal()`.
Overall, this improves performance about 2% in the free threading
build.

This also renames `PyStackRef_Is()` to `PyStackRef_IsExactly()` because
the macro requires that the tag bits of the arguments match, which is
only true in certain special cases.

11 months agoEnable aarch64 Ubuntu CI jobs (#125786)
Łukasz Langa [Fri, 22 Nov 2024 17:29:18 +0000 (18:29 +0100)] 
Enable aarch64 Ubuntu CI jobs (#125786)

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.

11 months agogh-115999: Add free-threaded specialization for `UNPACK_SEQUENCE` (#126600)
Kirill Podoprigora [Fri, 22 Nov 2024 17:00:35 +0000 (19:00 +0200)] 
gh-115999: Add free-threaded specialization for `UNPACK_SEQUENCE` (#126600)

Add free-threaded specialization for `UNPACK_SEQUENCE` opcode.
`UNPACK_SEQUENCE_TUPLE/UNPACK_SEQUENCE_TWO_TUPLE` are already thread safe since tuples are immutable.
`UNPACK_SEQUENCE_LIST` is not thread safe because of nature of lists (there is nothing preventing another thread from adding items to or removing them the list while the instruction is executing). To achieve thread safety we add a critical section to the implementation of `UNPACK_SEQUENCE_LIST`, especially around the parts where we check the size of the list and push items onto the stack.

---------

Co-authored-by: Matt Page <mpage@meta.com>
Co-authored-by: mpage <mpage@cs.stanford.edu>
11 months agogh-127117: Ensure the Correct Last Fields of PyInterpreterState and of _PyRuntimeStat...
Eric Snow [Fri, 22 Nov 2024 16:37:02 +0000 (09:37 -0700)] 
gh-127117: Ensure the Correct Last Fields of PyInterpreterState and of _PyRuntimeState (gh-127118)

We add some comments so contributors can be aware and we move one out-of-place field up.

11 months agogh-86463: Fix a trailing space in argparse.rst (#127162)
Serhiy Storchaka [Fri, 22 Nov 2024 16:34:05 +0000 (18:34 +0200)] 
gh-86463: Fix a trailing space in argparse.rst (#127162)