]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
11 months agogh-122431: Disallow negative values in `readline.append_history_file` (#122469)
Peter Bierma [Thu, 5 Dec 2024 16:07:38 +0000 (11:07 -0500)] 
gh-122431: Disallow negative values in `readline.append_history_file` (#122469)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months agogh-127413: allow to show specialized bytecode via `dis` CLI (#127414)
Bénédikt Tran [Thu, 5 Dec 2024 15:01:59 +0000 (16:01 +0100)] 
gh-127413: allow to show specialized bytecode via `dis` CLI (#127414)

11 months agogh-93312: Include <sys/pidfd.h> to get PIDFD_NONBLOCK (#127593)
Victor Stinner [Thu, 5 Dec 2024 09:39:44 +0000 (10:39 +0100)] 
gh-93312: Include <sys/pidfd.h> to get PIDFD_NONBLOCK (#127593)

11 months agogh-119182: Complete PyUnicodeWriter documentation (#127607)
Victor Stinner [Thu, 5 Dec 2024 09:37:14 +0000 (10:37 +0100)] 
gh-119182: Complete PyUnicodeWriter documentation (#127607)

11 months agogh-127434: Fix iOS `xcrun --sdk` clang/ar scripts to allow arguments with spaces...
Feodor Fitsner [Thu, 5 Dec 2024 03:00:20 +0000 (19:00 -0800)] 
gh-127434: Fix iOS `xcrun --sdk` clang/ar scripts to allow arguments with spaces (#127575)

Added shell escaping to ensure iOS compiler shims can accept arguments with spaces.

11 months agogh-127503: Emscripten make Python.sh function as proper Python CLI (#127506)
Hood Chatham [Thu, 5 Dec 2024 00:44:50 +0000 (01:44 +0100)] 
gh-127503: Emscripten make Python.sh function as proper Python CLI (#127506)

Modifies the python.sh script to work on macOS, and adapt to recent emscripten changes.

11 months agogh-127146: Emscripten: Skip segfaults in test suite (#127151)
Hood Chatham [Thu, 5 Dec 2024 00:26:25 +0000 (01:26 +0100)] 
gh-127146: Emscripten: Skip segfaults in test suite (#127151)

Added skips for tests known to cause problems when running on Emscripten.
These mostly relate to the limited stack depth on Emscripten.

11 months agogh-127111: Apply prettier formatter to Emscripten web example (#127551)
Hood Chatham [Thu, 5 Dec 2024 00:25:06 +0000 (01:25 +0100)] 
gh-127111: Apply prettier formatter to Emscripten web example (#127551)

Cleaned up formatting (and a stray closing tag) of the web example HTML and JS.

11 months agoGH-126795: Increase the JIT side-exit threshold from 64 to 4096 (GH-127155)
Brandt Bucher [Wed, 4 Dec 2024 23:01:28 +0000 (15:01 -0800)] 
GH-126795: Increase the JIT side-exit threshold from 64 to 4096 (GH-127155)

11 months agoEnable native AArch64 Ubuntu CI jobs (#127584)
Diego Russo [Wed, 4 Dec 2024 22:12:06 +0000 (22:12 +0000)] 
Enable native AArch64 Ubuntu CI jobs (#127584)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
11 months agogh-127536: Add missing locks in listobject.c (GH-127580)
Sam Gross [Wed, 4 Dec 2024 19:12:15 +0000 (19:12 +0000)] 
gh-127536: Add missing locks in listobject.c (GH-127580)

We were missing locks around some list operations in the free threading
build.

11 months agogh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in datetime.strptim...
Beomsoo Kim [Wed, 4 Dec 2024 18:30:51 +0000 (03:30 +0900)] 
gh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in datetime.strptime patterns (#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).

11 months agogh-127481: Add `EPOLLWAKEUP` to the `select` module (GH-127482)
RUANG (James Roy) [Wed, 4 Dec 2024 13:30:38 +0000 (21:30 +0800)] 
gh-127481: Add `EPOLLWAKEUP` to the `select` module (GH-127482)

11 months agogh-123378: Ensure results of `PyUnicode*Error_Get{Start,End}` are clamped (GH-123380)
Bénédikt Tran [Wed, 4 Dec 2024 13:13:52 +0000 (14:13 +0100)] 
gh-123378: Ensure results of `PyUnicode*Error_Get{Start,End}` are clamped (GH-123380)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
11 months agogh-126524: Run `regen-unicodedata` as a part of our CI (#126682)
sobolevn [Wed, 4 Dec 2024 10:01:46 +0000 (13:01 +0300)] 
gh-126524: Run `regen-unicodedata` as a part of our CI (#126682)

11 months agogh-127572: Fix `test_structmembers` initialization (GH-127577)
Sam Gross [Wed, 4 Dec 2024 08:58:22 +0000 (08:58 +0000)] 
gh-127572: Fix `test_structmembers` initialization (GH-127577)

gh-127572: Fix `test_structmembers` initialization.

The 'C' format code expects an `int` as a destination (not a `char`).
This led to test failures on big-endian platforms like s390x. Use the
'c' format code, which expects a `char` as the destination (but requires
a Python byte objects instead of a str).

11 months agoItertool recipe additions (gh-127483)
Raymond Hettinger [Wed, 4 Dec 2024 00:20:01 +0000 (18:20 -0600)] 
Itertool recipe additions (gh-127483)

11 months agogh-127146: Resolve some minor problems in Emscripten tests (#127565)
Hood Chatham [Wed, 4 Dec 2024 00:06:20 +0000 (01:06 +0100)] 
gh-127146: Resolve some minor problems in Emscripten tests (#127565)

Adjusts some Emscripten test exclusions regarding strftime, fma, and stack depth.

11 months agogh-112192: Increase the trace module coverage precision to one decimal (#126972)
RUANG (James Roy) [Tue, 3 Dec 2024 22:33:13 +0000 (06:33 +0800)] 
gh-112192: Increase the trace module coverage precision to one decimal (#126972)

11 months agogh-115999: Enable specialization of `CALL` instructions in free-threaded builds ...
mpage [Tue, 3 Dec 2024 19:20:20 +0000 (11:20 -0800)] 
gh-115999: Enable specialization of `CALL` instructions in free-threaded builds (#127123)

The CALL family of instructions were mostly thread-safe already and only required a small number of changes, which are documented below.

A few changes were needed to make CALL_ALLOC_AND_ENTER_INIT thread-safe:

Added _PyType_LookupRefAndVersion, which returns the type version corresponding to the returned ref.

Added _PyType_CacheInitForSpecialization, which takes an init method and the corresponding type version and only populates the specialization cache if the current type version matches the supplied version. This prevents potentially caching a stale value in free-threaded builds if we race with an update to __init__.

Only cache __init__ functions that are deferred in free-threaded builds. This ensures that the reference to __init__ that is stored in the specialization cache is valid if the type version guard in _CHECK_AND_ALLOCATE_OBJECT passes.
Fix a bug in _CREATE_INIT_FRAME where the frame is pushed to the stack on failure.

A few other miscellaneous changes were also needed:

Use {LOCK,UNLOCK}_OBJECT in LIST_APPEND. This ensures that the list's per-object lock is held while we are appending to it.

Add missing co_tlbc for _Py_InitCleanup.

Stop/start the world around setting the eval frame hook. This allows us to read interp->eval_frame non-atomically and preserves the behavior of _CHECK_PEP_523 documented below.

11 months agogh-127271: Replace use of PyCell_GET/SET (gh-127272)
Neil Schemenauer [Tue, 3 Dec 2024 18:33:06 +0000 (10:33 -0800)] 
gh-127271: Replace use of PyCell_GET/SET (gh-127272)

* Replace uses of `PyCell_GET` and `PyCell_SET`.  These macros are not
  safe to use in the free-threaded build.  Use `PyCell_GetRef()` and
  `PyCell_SetTakeRef()` instead.

* Since `PyCell_GetRef()` returns a strong rather than borrowed ref, some
  code restructuring was required, e.g. `frame_get_var()` returns a strong
  ref now.

* Add critical sections to `PyCell_GET` and `PyCell_SET`.

* Move critical_section.h earlier in the Python.h file.

* Add `PyCell_GET` to the free-threading howto table of APIs that return
  borrowed refs.

* Add additional unit tests for free-threading.

11 months agogh-115999: Add free-threaded specialization for `SEND` (gh-127426)
Neil Schemenauer [Tue, 3 Dec 2024 18:25:12 +0000 (10:25 -0800)] 
gh-115999: Add free-threaded specialization for `SEND` (gh-127426)

No additional thread safety changes are required.  Note that sending to
a generator that is shared between threads is currently not safe in the
free-threaded build.

11 months agogh-127421: Fix race in test_start_new_thread_failed (#127549)
mpage [Tue, 3 Dec 2024 17:50:58 +0000 (09:50 -0800)] 
gh-127421: Fix race in test_start_new_thread_failed (#127549)

Fix race in test_start_new_thread_failed

When we succeed in starting a new thread, for example if setrlimit
was ineffective, we must wait for the newly spawned thread to exit.
Otherwise, we run the risk that the newly spawned thread will race
with runtime finalization and access memory that has already been
clobbered/freed.

`_thread.start_new_thread()` only spawns daemon threads, which the runtime
does not wait for at shutdown, and does not return a handle. Use
`_thread.start_joinable_thread()` and join the resulting handle when
the thread is started successfully.

11 months agogh-115999: Specialize `LOAD_SUPER_ATTR` in free-threaded builds (gh-127128)
Neil Schemenauer [Tue, 3 Dec 2024 17:32:26 +0000 (09:32 -0800)] 
gh-115999: Specialize `LOAD_SUPER_ATTR` in free-threaded builds (gh-127128)

Use existing helpers to atomically modify the bytecode.  Add unit tests
to ensure specializing is happening as expected.  Add test_specialize.py
that can be used with ThreadSanitizer to detect data races.
Fix thread safety issue with cell_set_contents().

11 months agogh-127347: Document `traceback.print_list` (#127348)
Tomas R. [Tue, 3 Dec 2024 16:08:39 +0000 (17:08 +0100)] 
gh-127347: Document `traceback.print_list` (#127348)

Previously, `traceback.print_list` didn't have a documentation entry and was not exposed in `traceback.__all__`. Now it has a documentation entry and is exposed in `__all__`.

11 months agogh-127255: Make `CopyComPointer` public and add to `ctypes` doc. (GH-127275)
Jun Komoda [Tue, 3 Dec 2024 15:35:08 +0000 (00:35 +0900)] 
gh-127255: Make `CopyComPointer` public and add to `ctypes` doc. (GH-127275)

11 months agogh-117657: TSAN Fix races in `PyMember_Get` and `PyMember_Set` for C extensions ...
Daniele Parmeggiani [Tue, 3 Dec 2024 14:41:53 +0000 (15:41 +0100)] 
gh-117657: TSAN Fix races in `PyMember_Get` and `PyMember_Set` for C extensions (GH-123211)

11 months agogh-126585: Add EHWPOISON error code (#126586)
RUANG (James Roy) [Tue, 3 Dec 2024 12:45:50 +0000 (20:45 +0800)] 
gh-126585: Add EHWPOISON error code (#126586)

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)