]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
7 months agogh-131441: Add a set of asserts to test.test_capi.test_list (#131442)
Nybblista [Thu, 20 Mar 2025 10:12:15 +0000 (13:12 +0300)] 
gh-131441: Add a set of asserts to test.test_capi.test_list (#131442)

7 months agogh-128421: add critical section around `traceback.tb_next` (#131322)
Kumar Aditya [Thu, 20 Mar 2025 06:33:54 +0000 (12:03 +0530)] 
gh-128421: add critical section around `traceback.tb_next` (#131322)

7 months agogh-131401: fix data races in exception handling (#131447)
Kumar Aditya [Thu, 20 Mar 2025 06:32:05 +0000 (12:02 +0530)] 
gh-131401: fix data races in exception handling (#131447)

7 months agoGH-123599: Deprecate duplicate `pathname2url()` implementation (#127380)
Barney Gale [Thu, 20 Mar 2025 00:54:36 +0000 (00:54 +0000)] 
GH-123599: Deprecate duplicate `pathname2url()` implementation (#127380)

Call `urllib.request.pathname2url()` from `pathlib.Path.as_uri()`, and
deprecate the duplicate implementation in `PurePath`.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
7 months agogh-131238: Cleanup pycore_runtime.h includes (#131486)
Victor Stinner [Thu, 20 Mar 2025 00:47:30 +0000 (01:47 +0100)] 
gh-131238: Cleanup pycore_runtime.h includes (#131486)

7 months agogh-131238: Remove pycore_lock.h includes (#131483)
Victor Stinner [Wed, 19 Mar 2025 23:46:25 +0000 (00:46 +0100)] 
gh-131238: Remove pycore_lock.h includes (#131483)

PyMutex type is now part of <Python.h>, it's no longer needed to
include <pycore_lock.h> to get it.

7 months agogh-131238: Move pycore_obmalloc.h include to pycore_runtime_structs.h (#131482)
Victor Stinner [Wed, 19 Mar 2025 23:32:30 +0000 (00:32 +0100)] 
gh-131238: Move pycore_obmalloc.h include to pycore_runtime_structs.h (#131482)

Move pycore_obmalloc.h include from pycore_interp_structs.h to
pycore_runtime_structs.h.

Add also comment explaining the purpose of each include in
pycore_interp_structs.h, pycore_runtime_structs.h and
pycore_structs.h.

Remove <stdbool.h> and <stddef.h> from pycore_structs.h.

7 months agogh-131238: Use pycore_interp_structs.h header (#131481)
Victor Stinner [Wed, 19 Mar 2025 23:13:25 +0000 (00:13 +0100)] 
gh-131238: Use pycore_interp_structs.h header (#131481)

Replace pycore_runtime_structs.h include with pycore_interp_structs.h
include in internal headers.

7 months agogh-129598: ast: allow multi stmts for ast single with ';' (#129620)
Tomasz Pytel [Wed, 19 Mar 2025 22:29:40 +0000 (18:29 -0400)] 
gh-129598: ast: allow multi stmts for ast single with ';' (#129620)

7 months agogh-131238: Remove more includes from pycore_interp.h (#131480)
Victor Stinner [Wed, 19 Mar 2025 22:01:32 +0000 (23:01 +0100)] 
gh-131238: Remove more includes from pycore_interp.h (#131480)

7 months agoGH-123599: Remove duplicate `url2pathname()` implementation (#127237)
Barney Gale [Wed, 19 Mar 2025 21:08:32 +0000 (21:08 +0000)] 
GH-123599: Remove duplicate `url2pathname()` implementation (#127237)

Call `urllib.request.url2pathname()` from `pathlib.Path.from_uri()` rather
than re-implementing it. This paves the way for solving the main issue
(ignoring local authorities and rejecting non-local ones) in urllib, not
pathlib.

7 months agogh-126835: Move constant tuple folding from ast_opt to CFG (#130769)
Yan Yanchii [Wed, 19 Mar 2025 20:59:55 +0000 (21:59 +0100)] 
gh-126835: Move constant tuple folding from ast_opt to CFG (#130769)

7 months agoGH-131473: Add missing %(AdditionalOptions) reference to pythoncore.vcxproj (GH-131475)
Chris Eibl [Wed, 19 Mar 2025 19:50:04 +0000 (20:50 +0100)] 
GH-131473: Add missing %(AdditionalOptions) reference to pythoncore.vcxproj (GH-131475)

7 months agoGH-125866: Deprecate `nturl2path` module (#131432)
Barney Gale [Wed, 19 Mar 2025 19:33:01 +0000 (19:33 +0000)] 
GH-125866: Deprecate `nturl2path` module (#131432)

Deprecate the `nturl2path` module. Its functionality is merged into
`urllib.request`.

Add `tests.test_nturl2path` to exercise `nturl2path`, as it's no longer
covered by `test_urllib`.

7 months agoGH-130956: Only emit AArch64 trampolines for long jumps (GH-131041)
Diego Russo [Wed, 19 Mar 2025 19:19:21 +0000 (19:19 +0000)] 
GH-130956: Only emit AArch64 trampolines for long jumps (GH-131041)

7 months agogh-91349: Replace zlib with zlib-ng in Windows build (GH-131438)
Steve Dower [Wed, 19 Mar 2025 19:03:25 +0000 (19:03 +0000)] 
gh-91349: Replace zlib with zlib-ng in Windows build (GH-131438)

7 months agoGH-121970: Extract `pydoc_topics` into a new extension (#131256)
Adam Turner [Wed, 19 Mar 2025 18:35:11 +0000 (18:35 +0000)] 
GH-121970: Extract `pydoc_topics` into a new extension (#131256)

7 months agogh-131238: Remove many includes from pycore_interp.h (#131472)
Victor Stinner [Wed, 19 Mar 2025 17:46:24 +0000 (18:46 +0100)] 
gh-131238: Remove many includes from pycore_interp.h (#131472)

7 months agogh-131117: Update tp_finalize example to use PyErr_GetRaisedException (#131118)
Cody Maloney [Wed, 19 Mar 2025 17:27:55 +0000 (10:27 -0700)] 
gh-131117: Update tp_finalize example to use PyErr_GetRaisedException (#131118)

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

Update to point to the suggested replacement function
PyErr_GetRaisedException() which has a sample usage.

7 months agogh-130931: Add pycore_interpframe.h internal header (#131249)
Victor Stinner [Wed, 19 Mar 2025 17:17:44 +0000 (18:17 +0100)] 
gh-130931: Add pycore_interpframe.h internal header (#131249)

Move _PyInterpreterFrame and associated functions
to a new pycore_interpframe.h header.

7 months agogh-90548: Make musl test skips smarter (fixes Alpine errors) (#131313)
R. David Murray [Wed, 19 Mar 2025 17:05:09 +0000 (13:05 -0400)] 
gh-90548: Make musl test skips smarter (fixes Alpine errors) (#131313)

* Make musl test skips smarter (fixes Alpine errors)

A relatively small number of tests fail when the underlying c library is
provided by musl.  This was originally reported in bpo-46390 by
Christian Heimes.  Among other changes, these tests were marked for
skipping in gh-31947/ef1327e3 as part of bpo-40280 (emscripten support),
but the skips were conditioned on the *platform* being emscripten (or
wasi, skips for which ere added in 9b50585e02).

In gh-131071 Victor Stinner added a linked_to_musl function to enable
skipping a test in test_math that fails under musl, like it does on a
number of other platforms.  This check can successfully detect that
python is running under musl on Alpine, which was the original problem
report in bpo-46390.

This PR replaces Victor's solution with an enhancement to
platform.libc_ver that does the check more cheaply, and also gets the
version number.  The latter is important because the math test being
skipped is due to a bug in musl that has been fixed, but as of this
checkin date has not yet been released.  When it is, the test skip can
be fixed to check for the minimum needed version.

The enhanced version of linked_to_musl is also used to do the skips of
the other tests that generically fail under musl, as opposed to
emscripten or wasi only failures.  This will allow these tests to be
skipped automatically on Alpine.

This PR does *not* enhance libc_ver to support emscripten and wasi, as
I'm not familiar with those platforms; instead it returns a version
triple of (0, 0, 0) for those platforms.  This means the musl tests will
be skipped regardless of musl version, so ideally someone will add
support to libc_ver for these platforms.

* Platform tests and bug fixes.

In adding tests for the new platform code I found a bug in the old code:
if a valid version is passed for version and it is greater than the
version found for an so *and* there is no glibc version, then the
version from the argument was returned.  The code changes here fix
that.

* Add support docs, including for some preexisting is_xxx's.

* Add news item about libc_ver enhancement.

* Prettify platform re expression using re.VERBOSE.

7 months agogh-131238: Remove pycore_runtime.h from pycore_pystate.h (#131356)
Victor Stinner [Wed, 19 Mar 2025 16:33:24 +0000 (17:33 +0100)] 
gh-131238: Remove pycore_runtime.h from pycore_pystate.h (#131356)

* Remove includes from pycore_pystate.h:

  * pycore_runtime_structs.h
  * pycore_runtime.h
  * pycore_tstate.h
  * pycore_interp.h

* Reorganize internal headers. Move _gc_thread_state from
  pycore_interp_structs.h to pycore_tstate.h.
* Add 3 new header files to PCbuild/pythoncore.vcxproj.

7 months agogh-111178: Fix function signatures in legacy_tracing.c (#131464)
Victor Stinner [Wed, 19 Mar 2025 15:54:41 +0000 (16:54 +0100)] 
gh-111178: Fix function signatures in legacy_tracing.c (#131464)

7 months agogh-111178: Fix function signatures in _testbuffer.c (#131463)
Victor Stinner [Wed, 19 Mar 2025 15:54:18 +0000 (16:54 +0100)] 
gh-111178: Fix function signatures in _testbuffer.c (#131463)

7 months agogh-130587: Add hand-written docs for non-OP tokens (GH-130588)
Petr Viktorin [Wed, 19 Mar 2025 15:42:11 +0000 (16:42 +0100)] 
gh-130587: Add hand-written docs for non-OP tokens (GH-130588)

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
7 months agogh-130931: Add pycore_typedefs.h internal header (#131396)
Victor Stinner [Wed, 19 Mar 2025 14:23:32 +0000 (15:23 +0100)] 
gh-130931: Add pycore_typedefs.h internal header (#131396)

Declare _PyInterpreterFrame and _PyRuntimeState types before
declaring their structure members. Break reference cycles between
header files.

7 months agoDocs: Fix documentation for "PyTypeObject Definition" (GH-130936)
Yuki Kobayashi [Wed, 19 Mar 2025 13:46:32 +0000 (22:46 +0900)] 
Docs: Fix documentation for "PyTypeObject Definition" (GH-130936)

The structure definition for `PyTypeObject` is in `Include/cpython/object.h`,
not in `Include/object.h`.

7 months agogh-111178: Fix function signatures for test_types (#131455)
Victor Stinner [Wed, 19 Mar 2025 13:46:17 +0000 (14:46 +0100)] 
gh-111178: Fix function signatures for test_types (#131455)

7 months agogh-111178: Fix function signatures for test_iter (#131456)
Victor Stinner [Wed, 19 Mar 2025 13:42:51 +0000 (14:42 +0100)] 
gh-111178: Fix function signatures for test_iter (#131456)

7 months agogh-131263: Skip test_timerfd_negative on NetBSD to prevent system freeze (#131431)
Furkan Onder [Wed, 19 Mar 2025 11:24:09 +0000 (14:24 +0300)] 
gh-131263: Skip test_timerfd_negative on NetBSD to prevent system freeze (#131431)

7 months agogh-130655: Add tests for `gettext.find()` (GH-130691)
Stan Ulbrych [Wed, 19 Mar 2025 10:52:03 +0000 (10:52 +0000)] 
gh-130655: Add tests for `gettext.find()` (GH-130691)

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
7 months agoGH-131358: Add encoding alias cseuckr for euc_kr (#131370)
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) [Wed, 19 Mar 2025 09:29:20 +0000 (14:59 +0530)] 
GH-131358: Add encoding alias cseuckr for euc_kr (#131370)

* Add encoding alias cseuckr for euc_kr

* Update Misc/NEWS.d/next/Library/2025-03-17-21-35-53.gh-issue-131358.YVZ6yo.rst

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agogh-131401: fix data race in `_PyErr_Restore` (#131406)
Kumar Aditya [Wed, 19 Mar 2025 09:05:47 +0000 (14:35 +0530)] 
gh-131401: fix data race in `_PyErr_Restore` (#131406)

7 months agogh-131417: Mention asyncio Future and Task in docs for generic classes list (#131422)
Andrew Svetlov [Wed, 19 Mar 2025 09:05:23 +0000 (10:05 +0100)] 
gh-131417: Mention asyncio Future and Task in docs for generic classes list (#131422)

Mention asyncio Future and Task in docs for generic classes list

7 months agoDocs: fix shell command formatting (#131310)
partev [Wed, 19 Mar 2025 07:42:47 +0000 (03:42 -0400)] 
Docs: fix shell command formatting (#131310)

replace "zypper in" with "zypper install" to avoid incorrect highlighting

7 months agogh-121468: Ensure PDB cleans up event loop policies after using asyncio. (#131388)
Russell Keith-Magee [Wed, 19 Mar 2025 00:33:31 +0000 (08:33 +0800)] 
gh-121468: Ensure PDB cleans up event loop policies after using asyncio. (#131388)

Adds teardown logic, plus a change to asyncio.run usage, to avoid warnings when
running the test suite single process.

7 months agoGH-126367: `url2pathname()`: handle NTFS alternate data streams (#131428)
Barney Gale [Tue, 18 Mar 2025 23:37:12 +0000 (23:37 +0000)] 
GH-126367: `url2pathname()`: handle NTFS alternate data streams (#131428)

Adjust `url2pathname()` to decode embedded colon characters in Windows
URIs, rather than bailing out with an `OSError`.

7 months agogh-124666: Improve thread cleanup in test_android (#131427)
Malcolm Smith [Tue, 18 Mar 2025 22:30:22 +0000 (22:30 +0000)] 
gh-124666: Improve thread cleanup in test_android (#131427)

Ensures that failures in test setup don't result in dangling threads.

7 months agogh-130914: Make graphlib.TopologicalSorter.prepare() idempotent (#131317)
Daniel Pope [Tue, 18 Mar 2025 21:28:00 +0000 (21:28 +0000)] 
gh-130914: Make graphlib.TopologicalSorter.prepare() idempotent (#131317)

Closes #130914: Make graphlib.TopologicalSorter.prepare() idempotent

Relax the rules so that `.prepare()` can be called multiple times, provided that no work has been passed out by `.get_ready()` yet.

7 months agogh-118915: Document `PY_MONITORING_IS_INSTRUMENTED_EVENT` (GH-128026)
Yuki Kobayashi [Tue, 18 Mar 2025 16:34:01 +0000 (01:34 +0900)] 
gh-118915: Document `PY_MONITORING_IS_INSTRUMENTED_EVENT` (GH-128026)

7 months agogh-114917: Fix typo in getaddrinfo emulation (#131413)
Max Bachmann [Tue, 18 Mar 2025 13:31:13 +0000 (14:31 +0100)] 
gh-114917: Fix typo in getaddrinfo emulation (#131413)

7 months agogh-131402: add HMAC-SHA3 NIST test cases (#131407)
Bénédikt Tran [Tue, 18 Mar 2025 12:57:15 +0000 (13:57 +0100)] 
gh-131402: add HMAC-SHA3 NIST test cases (#131407)

Add NIST [1] tests for `HMAC-SHA-3/{224,256,384,512}`.

[1]: https://csrc.nist.gov/Projects/cryptographic-standards-and-guidelines/example-values

7 months agogh-130080: fix warnings in tests (#131400)
Irit Katriel [Tue, 18 Mar 2025 12:33:46 +0000 (12:33 +0000)] 
gh-130080: fix warnings in tests (#131400)

7 months agogh-131261: expat/refresh.sh: Expand list of manual steps (GH-131359)
Petr Viktorin [Tue, 18 Mar 2025 12:17:43 +0000 (13:17 +0100)] 
gh-131261: expat/refresh.sh: Expand list of manual steps (GH-131359)

7 months agogh-121284: Fix email address header folding with parsed encoded-word (GH-122754)
Mike Edmunds [Tue, 18 Mar 2025 11:07:17 +0000 (04:07 -0700)] 
gh-121284: Fix email address header folding with parsed encoded-word (GH-122754)

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

[Better fix from @bitdancer.]

---------

Co-authored-by: R David Murray <rdmurray@bitdance.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
7 months agogh-128002: fix tsan race in closing socket in `test_sslproto` (#131399)
Kumar Aditya [Tue, 18 Mar 2025 10:50:47 +0000 (16:20 +0530)] 
gh-128002: fix tsan race in closing socket in `test_sslproto` (#131399)

7 months agogh-131311: Consolidate reference handling in PyCStructUnionType_update_stginfo to...
Sergey Miryanov [Tue, 18 Mar 2025 10:50:22 +0000 (15:50 +0500)] 
gh-131311: Consolidate reference handling in PyCStructUnionType_update_stginfo to fix memory leak (GH-131312)

7 months agogh-114917: add support for AI_NUMERICSERV in getaddrinfo emulation (#114918)
Max Bachmann [Tue, 18 Mar 2025 10:26:51 +0000 (11:26 +0100)] 
gh-114917: add support for AI_NUMERICSERV in getaddrinfo emulation (#114918)

7 months agogh-128002: fix tsan race in closing socket in `test_ssl` (#131397)
Kumar Aditya [Tue, 18 Mar 2025 10:11:43 +0000 (15:41 +0530)] 
gh-128002: fix tsan race in closing socket in `test_ssl` (#131397)

7 months agogh-130132: properly free resources in `urrlib.urlopen` examples (#130280)
Kanishk Pachauri [Tue, 18 Mar 2025 09:27:05 +0000 (09:27 +0000)] 
gh-130132: properly free resources in `urrlib.urlopen` examples (#130280)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agogh-131094: Refine `math.isclose` docs (#131139)
Guy Jacoby [Tue, 18 Mar 2025 09:13:26 +0000 (02:13 -0700)] 
gh-131094: Refine `math.isclose` docs (#131139)

7 months agogh-120144: Make it possible to use `sys.monitoring` for bdb and make it default for...
Tian Gao [Mon, 17 Mar 2025 22:34:37 +0000 (18:34 -0400)] 
gh-120144: Make it possible to use `sys.monitoring` for bdb and make it default for pdb (#124533)

7 months agogh-131002: clarify how to enforce sqlite3 column types for generated fields (#131006)
Erlend E. Aasland [Mon, 17 Mar 2025 22:26:27 +0000 (23:26 +0100)] 
gh-131002: clarify how to enforce sqlite3 column types for generated fields (#131006)

7 months agogh-119786: Fix _PyExecutorObject link at jit.md file (#131382)
Nybblista [Mon, 17 Mar 2025 21:22:12 +0000 (00:22 +0300)] 
gh-119786: Fix _PyExecutorObject link at jit.md file (#131382)

7 months agogh-130080: implement PEP 765 (#130087)
Irit Katriel [Mon, 17 Mar 2025 20:48:54 +0000 (20:48 +0000)] 
gh-130080: implement PEP 765 (#130087)

7 months agoGH-131278: Add option to build with computed gotos on Windows with clang-cl (GH-131279)
Chris Eibl [Mon, 17 Mar 2025 20:32:23 +0000 (21:32 +0100)] 
GH-131278: Add option to build with computed gotos on Windows with clang-cl (GH-131279)

7 months agogh-131325: fix sendfile fallback implementation to drain data after writing to transp...
Kumar Aditya [Mon, 17 Mar 2025 19:22:57 +0000 (00:52 +0530)] 
gh-131325: fix sendfile fallback implementation to drain data after writing to transport (#131376)

7 months agogh-116738: remove multiprocessing suppressions (#131319)
Kumar Aditya [Mon, 17 Mar 2025 18:59:18 +0000 (00:29 +0530)] 
gh-116738: remove multiprocessing suppressions (#131319)

7 months agoFix test_pyrepl.TestDumbTerminal if PYTHON_BASIC_REPL set. (#131332)
R. David Murray [Mon, 17 Mar 2025 17:56:21 +0000 (13:56 -0400)] 
Fix test_pyrepl.TestDumbTerminal if PYTHON_BASIC_REPL set. (#131332)

Most of the tests that care already adjust PYTHON_BASIC_REPL as needed,
but this one doesn't, and it fails if the developer has the variable set.

7 months agoGH-127705: Move mortal decrefs to internal header and make sure _PyReftracerTrack...
Mark Shannon [Mon, 17 Mar 2025 17:23:50 +0000 (17:23 +0000)] 
GH-127705: Move mortal decrefs to internal header and make sure _PyReftracerTrack is called

7 months agoGH-125174: Make immortality "sticky" (GH-131355)
Mark Shannon [Mon, 17 Mar 2025 17:22:35 +0000 (17:22 +0000)] 
GH-125174: Make immortality "sticky" (GH-131355)

* Use a higher threshold for immortality for INCREF than DECREF

7 months agogh-131268: Adjust _PYTHREAD_NAME_MAXLEN on BSD (#131345)
Victor Stinner [Mon, 17 Mar 2025 16:52:59 +0000 (17:52 +0100)] 
gh-131268: Adjust _PYTHREAD_NAME_MAXLEN on BSD (#131345)

Adjust _PYTHREAD_NAME_MAXLEN constant on FreeBSD and NetBSD.
Initial patch by Xavier G.

7 months agogh-131281: Add include for pystats builds (#131369)
Ken Jin [Mon, 17 Mar 2025 16:36:06 +0000 (00:36 +0800)] 
gh-131281: Add include for pystats builds (#131369)

Add include to for pystats builds

7 months agoGH-131291: Suppress clang-specific warning in python_uwp.cpp (GH-131292)
Chris Eibl [Mon, 17 Mar 2025 16:22:25 +0000 (17:22 +0100)] 
GH-131291: Suppress clang-specific warning in python_uwp.cpp (GH-131292)

7 months agogh-116666: Add "token" glossary term (GH-130888)
Petr Viktorin [Mon, 17 Mar 2025 16:05:47 +0000 (17:05 +0100)] 
gh-116666: Add "token" glossary term (GH-130888)

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

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
7 months agogh-126895: Fix readline module in free-threaded build (#131208)
Tomasz Pytel [Mon, 17 Mar 2025 15:57:11 +0000 (11:57 -0400)] 
gh-126895: Fix readline module in free-threaded build (#131208)

The underlying readline library is not thread-safe so this adds `@critical_section` to functions that use it.

7 months agoDocs: Fix incorrect sphinx markup for a class member (GH-130970)
Yuki Kobayashi [Mon, 17 Mar 2025 15:28:56 +0000 (00:28 +0900)] 
Docs: Fix incorrect sphinx markup for a class member (GH-130970)

7 months agogh-111178: fix UBSan failures in `Modules/_ssl.c` (GH-130719)
Bénédikt Tran [Mon, 17 Mar 2025 15:25:28 +0000 (16:25 +0100)] 
gh-111178: fix UBSan failures in `Modules/_ssl.c` (GH-130719)

* fix UBSan failures for `PySSLContext`, `PySSLSocket`, `PySSLMemoryBIO`, `PySSLSession`

7 months agoGH-131238: More refactoring of core header files (GH-131351)
Mark Shannon [Mon, 17 Mar 2025 14:41:05 +0000 (14:41 +0000)] 
GH-131238: More refactoring of core header files (GH-131351)

Adds new pycore_stats.h header file to help break dependencies involving the pycore_code.h header.

7 months agogh-131261: Update libexpat to 2.7.0 (CVE-2024-8176) (#131272)
Gregory P. Smith [Mon, 17 Mar 2025 13:55:02 +0000 (06:55 -0700)] 
gh-131261: Update libexpat to 2.7.0 (CVE-2024-8176) (#131272)

7 months agogh-131238: Add explicit includes to pycore headers (#131257)
Victor Stinner [Mon, 17 Mar 2025 11:32:43 +0000 (12:32 +0100)] 
gh-131238: Add explicit includes to pycore headers (#131257)

7 months agogh-131238: Convert pycore_pystate.h static inline to functions (#131352)
Victor Stinner [Mon, 17 Mar 2025 11:31:55 +0000 (12:31 +0100)] 
gh-131238: Convert pycore_pystate.h static inline to functions (#131352)

Convert static inline functions to functions:

* _Py_IsMainThread()
* _PyInterpreterState_Main()
* _Py_IsMainInterpreterFinalizing()
* _Py_GetMainConfig()

7 months agogh-129843: fix pure Python implementation of `warnings.warn_explicit` (#129848)
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) [Mon, 17 Mar 2025 10:49:53 +0000 (16:19 +0530)] 
gh-129843: fix pure Python implementation of `warnings.warn_explicit` (#129848)

The pure Python implementation of `warnings.warn_explicit` constructs a `WarningMessage`
with an incorrect source (it incorrectly sets the WarningMessage's line to the given `source`).

7 months agogh-127667: refactor and improve `_hashopenssl.c` error branches (#131145)
Bénédikt Tran [Mon, 17 Mar 2025 10:12:55 +0000 (11:12 +0100)] 
gh-127667: refactor and improve `_hashopenssl.c` error branches (#131145)

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

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

7 months agogh-131316: handle NULL values returned by HACL* functions (#131324)
Bénédikt Tran [Mon, 17 Mar 2025 10:10:39 +0000 (11:10 +0100)] 
gh-131316: handle NULL values returned by HACL* functions  (#131324)

- Handle NULL returned by allocation functions.
- Handle NULL returned by copy functions.
- Suppress unused impossible return codes.

7 months agogh-130149: cleanup refactorization of `test_hmac.py` (#131318)
Bénédikt Tran [Mon, 17 Mar 2025 10:10:03 +0000 (11:10 +0100)] 
gh-130149: cleanup refactorization of `test_hmac.py` (#131318)

New features:

* refactor `hashlib_helper.requires_hashdigest` in prevision of a future
  `hashlib_helper.requires_builtin_hashdigest` for built-in hashes only
* add `hashlib_helper.requires_openssl_hashdigest` to request OpenSSL
   hashes, assuming that `_hashlib` exists.

Refactoring:

* split hmac.copy() test by implementation
* update how algorithms are discovered for RFC test cases
* simplify how OpenSSL hash digests are requested
* refactor hexdigest tests for RFC test vectors
* typo fix: `assert_hmac_hexdigest_by_new` -> `assert_hmac_hexdigest_by_name`

Improvements:

* strengthen contract on `hmac_new_by_name` and `hmac_digest_by_name`
* rename mixin classes to better match their responsibility

7 months agogh-93096: Update and document `pickletools` CLI (#131273)
Semyon Moroz [Mon, 17 Mar 2025 09:36:30 +0000 (13:36 +0400)] 
gh-93096: Update and document `pickletools` CLI (#131273)

7 months agoGH-131238: Core header refactor (GH-131250)
Mark Shannon [Mon, 17 Mar 2025 09:19:04 +0000 (09:19 +0000)] 
GH-131238: Core header refactor (GH-131250)

* Moves most structs in pycore_ header files into pycore_structs.h and pycore_runtime_structs.h

* Removes many cross-header dependencies

7 months agogh-131339: test PyBytes_Size for a zero-size bytes object (#131340)
Nybblista [Mon, 17 Mar 2025 08:38:37 +0000 (11:38 +0300)] 
gh-131339: test PyBytes_Size for a zero-size bytes object (#131340)

7 months agogh-127146: Update test skips for Emscripten 4.0.2 (#129474)
Hood Chatham [Sun, 16 Mar 2025 22:02:27 +0000 (23:02 +0100)] 
gh-127146: Update test skips for Emscripten 4.0.2 (#129474)

Updates test skips to reflect capabilities of Emscripten 4.0.2.

7 months agogh-119786: add `JUMP_BACKWARD` macro to the Jumps section (#131213)
Nybblista [Sun, 16 Mar 2025 20:04:39 +0000 (23:04 +0300)] 
gh-119786: add `JUMP_BACKWARD` macro to the Jumps section (#131213)

add JUMP_BACKWARD opcode macro to the Jumps section

JUMP_BACKWARD opcode macro added to the Jumps section in
interpreter.md file at InternalDocs.

7 months agogh-131306: Remove unused code related to `BINARY_SUBSCR` (#131307)
Tomas R. [Sun, 16 Mar 2025 16:37:29 +0000 (17:37 +0100)] 
gh-131306: Remove unused code related to `BINARY_SUBSCR` (#131307)

7 months agogh-131327: Document winsound.SND_APPLICATION (#131328)
AN Long [Sun, 16 Mar 2025 15:27:24 +0000 (00:27 +0900)] 
gh-131327: Document winsound.SND_APPLICATION (#131328)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agogh-131254: ensure that `BROWSER` is not set for `test_webbrowser` on macOS (#131276)
Bénédikt Tran [Sun, 16 Mar 2025 14:39:30 +0000 (15:39 +0100)] 
gh-131254: ensure that `BROWSER` is not set for `test_webbrowser` on macOS (#131276)

7 months agogh-131277: allow `EnvironmentVarGuard` to unset more than one environment variable...
Bénédikt Tran [Sun, 16 Mar 2025 13:09:33 +0000 (14:09 +0100)] 
gh-131277: allow `EnvironmentVarGuard` to unset more than one environment variable at once (#131280)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
7 months agogh-130160: use `.. program::` directive for documenting `doctest` CLI (#131034)
donBarbos [Sun, 16 Mar 2025 11:53:22 +0000 (15:53 +0400)] 
gh-130160: use `.. program::` directive for documenting `doctest` CLI (#131034)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agoGH-130614: pathlib ABCs: improve support for receiving path metadata (#131259)
Barney Gale [Sun, 16 Mar 2025 06:11:20 +0000 (06:11 +0000)] 
GH-130614: pathlib ABCs: improve support for receiving path metadata (#131259)

In the private pathlib ABCs, replace `_WritablePath._write_info()` with
`_WritablePath._copy_from()`. This provides the target path object with
more control over the copying process, including support for querying and
setting metadata *before* the path is created.

Adjust `_ReadablePath.copy()` so that it forwards its keyword arguments to
`_WritablePath._copy_from()` of the target path object. This allows us to
remove the unimplemented *preserve_metadata* argument in the ABC method,
making it a `Path` exclusive.

7 months agoGH-131296: fix clang-cl warnings on Windows in pyshellext.cpp (GH-131300)
Chris Eibl [Sat, 15 Mar 2025 18:55:00 +0000 (19:55 +0100)] 
GH-131296:  fix clang-cl warnings on Windows in pyshellext.cpp (GH-131300)

fix unused warnings in pyshellext.cpp

7 months agoGH-131296: fix clang-cl warning on Windows in pytime.c (GH-131297)
Chris Eibl [Sat, 15 Mar 2025 18:41:34 +0000 (19:41 +0100)] 
GH-131296: fix clang-cl warning on Windows in pytime.c (GH-131297)

fix warning : integer literal is too large

to be represented in a signed integer type,
interpreting as unsigned [-Wimplicitly-unsigned-literal]

7 months agoGH-131296: fix clang-cl warnings on Windows in blake2module.c (#131299)
Chris Eibl [Sat, 15 Mar 2025 18:37:53 +0000 (19:37 +0100)] 
GH-131296: fix clang-cl warnings on Windows in blake2module.c (#131299)

work around unimportant clang-cl warnings in blake2module.c

7 months agogh-130213: update hacl_star_rev to 322f6d58290e0ed7f4ecb84fcce12917aa0f594b (GH-130960)
Chris Eibl [Sat, 15 Mar 2025 17:42:27 +0000 (18:42 +0100)] 
gh-130213: update hacl_star_rev to 322f6d58290e0ed7f4ecb84fcce12917aa0f594b (GH-130960)

Updates the HACL* implementation used by hashlib from upstream sources.

7 months agogh-130160: use `.. program::` directive for documenting `http.server` CLI (#131010)
donBarbos [Sat, 15 Mar 2025 16:28:56 +0000 (20:28 +0400)] 
gh-130160: use `.. program::` directive for documenting `http.server` CLI (#131010)

7 months agogh-131281: fix compile error due to `BINARY_SUBSCR` (GH-131283)
Xuanteng Huang [Sat, 15 Mar 2025 15:38:46 +0000 (23:38 +0800)] 
gh-131281: fix compile error due to `BINARY_SUBSCR` (GH-131283)

* fix compile error due to `BINARY_SUBSCR`

* replace stat_inc with `BINARY_OP`

7 months agogh-130480: Move duplicate `LOAD_SMALL_INT` optimization from codegen to CFG (#130481)
Yan Yanchii [Fri, 14 Mar 2025 21:23:27 +0000 (22:23 +0100)] 
gh-130480: Move duplicate `LOAD_SMALL_INT` optimization from codegen to CFG (#130481)

7 months agogh-121468: Fix the doctest failure for asyncio test on pdb (#131258)
Tian Gao [Fri, 14 Mar 2025 20:23:21 +0000 (16:23 -0400)] 
gh-121468: Fix the doctest failure for asyncio test on pdb (#131258)

7 months agoGH-130614: pathlib ABCs: delete vestigial `test_pathlib_abc` module (#131215)
Barney Gale [Fri, 14 Mar 2025 20:04:07 +0000 (20:04 +0000)] 
GH-130614: pathlib ABCs: delete vestigial `test_pathlib_abc` module (#131215)

Remove the `test.test_pathlib.test_pathlib_abc` test module, which was
hollowed out in previous commits. Its few remaining tests are most relevant
to `PurePath` and `Path`, so we move them into `test_pathlib`.

7 months agogh-121468: Add current asyncio task as a convenience variable in pdb (#124367)
Tian Gao [Fri, 14 Mar 2025 18:46:26 +0000 (14:46 -0400)] 
gh-121468: Add current asyncio task as a convenience variable in pdb (#124367)

7 months agoPost 3.14.0a6
Hugo van Kemenade [Fri, 14 Mar 2025 17:09:56 +0000 (19:09 +0200)] 
Post 3.14.0a6

7 months agoPython 3.14.0a6 v3.14.0a6
Hugo van Kemenade [Fri, 14 Mar 2025 15:04:35 +0000 (17:04 +0200)] 
Python 3.14.0a6

7 months agogh-121970: Revert "GH-121970: Extract ``pydoc_topics`` into a new extension (#129116...
Hugo van Kemenade [Fri, 14 Mar 2025 14:25:56 +0000 (16:25 +0200)] 
gh-121970: Revert "GH-121970: Extract ``pydoc_topics`` into a new extension (#129116)" (#131245)

Revert "GH-121970: Extract ``pydoc_topics`` into a new extension (#129116)"

This reverts commit 01bcf13a1c5bfca5124cf2e0679c9d1b25b04708.