]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
8 months agogh-130164: Fix inspect.Signature.bind() handling of positional-only args without...
Jacob Walls [Tue, 18 Feb 2025 15:19:04 +0000 (10:19 -0500)] 
gh-130164: Fix inspect.Signature.bind() handling of positional-only args without defaults (GH-130192)

Follow-up to 9c15202.

8 months agogh-44827: Improve error if BOM on first line of .po file (GH-130187)
Stan Ulbrych [Tue, 18 Feb 2025 13:59:34 +0000 (13:59 +0000)] 
gh-44827: Improve error if BOM on first line of .po file (GH-130187)

8 months agogh-111178: fix UBSan failures in `Modules/_lzmamodule.c` (GH-129783)
Bénédikt Tran [Tue, 18 Feb 2025 13:48:21 +0000 (14:48 +0100)] 
gh-111178: fix UBSan failures in `Modules/_lzmamodule.c` (GH-129783)

fix UBSan failures for LZMA objects

suppress unused return values

8 months agogh-130160: use `option` instead of `cmdoption` in `dis.rst` (#130255)
sobolevn [Tue, 18 Feb 2025 12:54:14 +0000 (15:54 +0300)] 
gh-130160: use `option` instead of `cmdoption` in `dis.rst` (#130255)

8 months agogh-130160: use `.. program::` directive for documenting `ensurepip` CLI (gh-130253)
Kanishk Pachauri [Tue, 18 Feb 2025 12:09:22 +0000 (17:39 +0530)] 
gh-130160: use `.. program::` directive for documenting `ensurepip` CLI (gh-130253)

8 months agoimprove `test_tasks` to use correct idiom for starting task in asyncio (#130257)
Kumar Aditya [Tue, 18 Feb 2025 12:08:25 +0000 (17:38 +0530)] 
improve `test_tasks` to use correct idiom for starting task in asyncio (#130257)

The test should use the correct idiom for starting the task, `loop._run_once` is private API which should not be used directly, instead use `asyncio.sleep(0)` for 1 event loop cycle.

8 months agogh-130230: Fix crash in pow() with only Decimal third argument (GH-130237)
Serhiy Storchaka [Tue, 18 Feb 2025 07:46:48 +0000 (09:46 +0200)] 
gh-130230: Fix crash in pow() with only Decimal third argument (GH-130237)

8 months agogh-130195: Remove unimplemented option from pygettext (#130196)
Stan Ulbrych [Tue, 18 Feb 2025 03:01:36 +0000 (03:01 +0000)] 
gh-130195: Remove unimplemented option from pygettext (#130196)

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
8 months agogh-118761: Improve import time of `cmd` module (#130056)
donBarbos [Mon, 17 Feb 2025 20:06:08 +0000 (00:06 +0400)] 
gh-118761: Improve import time of `cmd` module (#130056)

* Improve import time of `cmd` module
* Remove string import

8 months agoGH-127381: pathlib ABCs: remove `ReadablePath.rglob()` (#130207)
Barney Gale [Mon, 17 Feb 2025 19:15:59 +0000 (19:15 +0000)] 
GH-127381: pathlib ABCs: remove `ReadablePath.rglob()` (#130207)

Remove `ReadablePath.rglob()` from the private pathlib ABCs. This method is
a trivial wrapper around `glob()` and easily replaced.

8 months agoGH-125413: Add private metadata methods to `pathlib.Path.info` (#129897)
Barney Gale [Mon, 17 Feb 2025 19:15:25 +0000 (19:15 +0000)] 
GH-125413: Add private metadata methods to `pathlib.Path.info` (#129897)

Add the following private methods to `pathlib.Path.info`:

- `_posix_permissions()`: the POSIX file permissions (`S_IMODE(st_mode)`)
- `_file_id()`: the file ID (`(st_dev, st_ino)`)
- `_access_time_ns()`: the access time in nanoseconds (`st_atime_ns`)
- `_mod_time_ns()`: the modify time in nanoseconds (`st_mtime_ns`)
- `_bsd_flags()`: the BSD file flags (`st_flags`)
- `_xattrs()`: the file extended attributes as a list of key, value pairs,
  or an empty list if `listxattr()` or `getxattr()` fail in an ignorable
  way.

These methods replace `LocalCopyReader.read_metadata()`, and so we can
delete the `CopyReader` and `LocalCopyReader` classes. Rather than reading
metadata via `source._copy_reader.read_metadata()`, we instead call
`source.info._posix_permissions()`, `_access_time_ns()`, etc.

Preserving metadata is only supported for local-to-local copies at the
moment. To support copying metadata between arbitrary `ReadablePath` and
`WritablePath` objects, we'd need to make the new methods public and
documented.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
8 months agocover `**/*hashopenssl*` in CODEOWNERS (#130236)
Gregory P. Smith [Mon, 17 Feb 2025 19:09:16 +0000 (11:09 -0800)] 
cover `**/*hashopenssl*` in CODEOWNERS (#130236)

8 months agogh-125756: Document Pickler.clear_memo() (GH-125762)
Tomas R. [Mon, 17 Feb 2025 15:48:29 +0000 (16:48 +0100)] 
gh-125756: Document Pickler.clear_memo() (GH-125762)

8 months agogh-111178: fix UBSan failures in `Modules/_lsprof.c` (GH-129782)
Bénédikt Tran [Mon, 17 Feb 2025 13:53:03 +0000 (14:53 +0100)] 
gh-111178: fix UBSan failures in `Modules/_lsprof.c` (GH-129782)

Fix UBSan failures for `ProfilerObject`

Suppress unused return value

8 months agogh-111178: fix UBSan failures in `Modules/_jsonmodule.c` (GH-129781)
Bénédikt Tran [Mon, 17 Feb 2025 13:51:18 +0000 (14:51 +0100)] 
gh-111178: fix UBSan failures in `Modules/_jsonmodule.c` (GH-129781)

Fix UBSan failures for `PyScannerObject`, fix UBSan failures for `PyEncoderObject`

8 months agogh-129678: ConfigParser: do not write an empty unnamed section (GH-129679)
Andrey Efremov [Mon, 17 Feb 2025 13:24:57 +0000 (20:24 +0700)] 
gh-129678: ConfigParser: do not write an empty unnamed section (GH-129679)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
8 months agogh-129701: Fix a data race in `intern_common` in the free threaded build (GH-130089)
Sam Gross [Mon, 17 Feb 2025 13:15:40 +0000 (08:15 -0500)] 
gh-129701: Fix a data race in `intern_common` in the free threaded build (GH-130089)

* gh-129701: Fix a data race in `intern_common` in the free threaded build

* Use a mutex to avoid potentially returning a non-immortalized string,
  because immortalization happens after the insertion into the interned
  dict.

* Use `Py_DECREF()` calls instead of `Py_SET_REFCNT(s, Py_REFCNT(s) - 2)`
  for thread-safety. This code path isn't performance sensistive, so
  just use `Py_DECREF()` unconditionally for simplicity.

8 months agogh-130214: Document `PyEllipsis_Type` (GH-130215)
Yuki Kobayashi [Mon, 17 Feb 2025 12:56:33 +0000 (21:56 +0900)] 
gh-130214: Document `PyEllipsis_Type` (GH-130215)

8 months agogh-111178: fix UBSan failures in `Modules/_collectionsmodule.c` (#129773)
Bénédikt Tran [Mon, 17 Feb 2025 12:12:03 +0000 (13:12 +0100)] 
gh-111178: fix UBSan failures in `Modules/_collectionsmodule.c` (#129773)

Fix some UBSan failures for `dequeobject`, `dequeiterobject`, `defdictobject` and `tuplegetterobject`.

We also perform some cleanup by suppressing unused return values and renaming the
unused argument in `METH_NOARGS` methods to `dummy` for semantic purposes.

8 months agoCI: Use ImageOS (ubuntu24) instead of runner.os (Linux) in cache keys (#130200)
Hugo van Kemenade [Mon, 17 Feb 2025 11:53:55 +0000 (13:53 +0200)] 
CI: Use ImageOS (ubuntu24) instead of runner.os (Linux) in cache keys (#130200)

8 months agogh-130057: Pygettext: Support translator comments (GH-130061)
Tomas R. [Mon, 17 Feb 2025 10:41:28 +0000 (11:41 +0100)] 
gh-130057: Pygettext: Support translator comments (GH-130061)

8 months agogh-111178: fix UBSan failures in `Modules/_interp*module.c` (GH-129779)
Bénédikt Tran [Mon, 17 Feb 2025 10:34:14 +0000 (11:34 +0100)] 
gh-111178: fix UBSan failures in `Modules/_interp*module.c` (GH-129779)

Fix UBSan failures for `XIBufferViewObject`

Remove redundant casts, suppress unused return values

8 months agogh-111178: fix UBSan failures in `Objects/exceptions.c` (GH-128154)
Bénédikt Tran [Mon, 17 Feb 2025 10:03:16 +0000 (11:03 +0100)] 
gh-111178: fix UBSan failures in `Objects/exceptions.c` (GH-128154)

Fix UBSan failures for `PyBaseExceptionObject`, `PyStopIterationObject`, `PySystemExitObject`, `PyImportErrorObject`, `PyOSErrorObject`,  `PyNameErrorObject`,  `PyAttributeErrorObject`, `PySyntaxErrorObject`,  `KeyError`,  `UnicodeError*`, `PyBaseExceptionGroupObject`

Remove redundant casts

Align the naming convention `Py[...]_CAST(op)` where only an assert-only type check is performed.

8 months agogh-127750: Fix and optimize functools.singledispatchmethod() (GH-130008)
Serhiy Storchaka [Mon, 17 Feb 2025 09:11:20 +0000 (11:11 +0200)] 
gh-127750: Fix and optimize functools.singledispatchmethod() (GH-130008)

Remove broken singledispatchmethod caching introduced in gh-85160.
Achieve the same performance using different optimization.

* Add more tests.

* Fix issues with __module__ and __doc__ descriptors.

8 months agogh-130193: Increase test coverage of gettext.c2py (GH-130208)
Tomas R. [Mon, 17 Feb 2025 08:57:34 +0000 (09:57 +0100)] 
gh-130193: Increase test coverage of gettext.c2py (GH-130208)

8 months agogh-129805: Fix `bytes` annotation in `Tools/jit` (#129806)
sobolevn [Mon, 17 Feb 2025 07:55:30 +0000 (10:55 +0300)] 
gh-129805: Fix `bytes` annotation in `Tools/jit` (#129806)

8 months agogh-86069: Add more PyNumber_InPlacePower() tests (GH-130111)
Serhiy Storchaka [Mon, 17 Feb 2025 00:07:10 +0000 (02:07 +0200)] 
gh-86069: Add more PyNumber_InPlacePower() tests (GH-130111)

Test it with the third argument.

8 months agogh-118761: Revert "Improve import time of `subprocess` (GH-129427)" (#130201)
Gregory P. Smith [Sun, 16 Feb 2025 18:40:08 +0000 (10:40 -0800)] 
gh-118761: Revert "Improve import time of `subprocess` (GH-129427)" (#130201)

* Revert "gh-118761: Improve import time of `subprocess` (GH-129427)"

This reverts commit 49f24650e4541456872490ec2b59d6d186204891.
Also known as f502c8f6a6db4be27c97a0e5466383d117859b7f in 3.13 (PR #129447)
Also known as f65aa0d1bf7b636ab8f9d226429205854b24cd7a in 3.12 (PR #129448)

This caused bugs in the `__del__` finalizer:
 https://github.com/python/cpython/issues/118761#issuecomment-2661504264

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
8 months agopathlib ABCs: remove caching of path parser case sensitivity (#130194)
Barney Gale [Sun, 16 Feb 2025 17:08:55 +0000 (17:08 +0000)] 
pathlib ABCs: remove caching of path parser case sensitivity (#130194)

Remove the caching `_is_case_sensitive()` function.

The cache used to speed up `PurePath.[full_]match()` and `Path.[r]glob()`,
but that's no longer the case - these methods use
`self.parser is posixpath` to determine case sensitivity.

This makes the `pathlib._abc` module a little easier to backport to Python
3.8, where `functools.cache()` is unavailable.

8 months agogh-130179: Fix `persistent_{id,load}_attr` reference leaks in `_pickle` (#130180)
Sergey Miryanov [Sun, 16 Feb 2025 14:00:03 +0000 (19:00 +0500)] 
gh-130179: Fix `persistent_{id,load}_attr` reference leaks in `_pickle` (#130180)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
8 months agogh-130080: return in finally in subprocess.py (#130081)
Irit Katriel [Sun, 16 Feb 2025 13:52:04 +0000 (13:52 +0000)] 
gh-130080: return in finally in subprocess.py (#130081)

8 months agogh-130185: Fix unintentionally skipped tests in `test_functools` (#130186)
Tomas R. [Sun, 16 Feb 2025 13:34:54 +0000 (14:34 +0100)] 
gh-130185: Fix unintentionally skipped tests in `test_functools` (#130186)

8 months agogh-130139: always check ast node type in ast.parse() with ast input (#130140)
Irit Katriel [Sun, 16 Feb 2025 13:32:39 +0000 (13:32 +0000)] 
gh-130139: always check ast node type in ast.parse() with ast input (#130140)

8 months agogh-130177: Fix unintentionally skipped tests in test_gettext (GH-130178)
Tomas R. [Sun, 16 Feb 2025 12:14:37 +0000 (13:14 +0100)] 
gh-130177: Fix unintentionally skipped tests in test_gettext (GH-130178)

8 months agogh-127488: Add tests for Tools/i18n/msgfmt.py (GH-127540)
Tomas R. [Sun, 16 Feb 2025 12:05:01 +0000 (13:05 +0100)] 
gh-127488: Add tests for Tools/i18n/msgfmt.py (GH-127540)

8 months agogh-130169: Fix broken list markup in `Doc/c-api/function.rst` (#130174)
Stan Ulbrych [Sun, 16 Feb 2025 10:55:31 +0000 (10:55 +0000)] 
gh-130169: Fix broken list markup in `Doc/c-api/function.rst` (#130174)

8 months agoReplace non-breaking spaces with normal spaces (#130116)
AN Long [Sun, 16 Feb 2025 01:33:14 +0000 (10:33 +0900)] 
Replace non-breaking spaces with normal spaces (#130116)

Using normal spaces in place of non-breaking spaces.

8 months agoGH-128520: Subclass `abc.ABC` in `pathlib._abc` (#128745)
Barney Gale [Sun, 16 Feb 2025 00:37:26 +0000 (00:37 +0000)] 
GH-128520: Subclass `abc.ABC` in `pathlib._abc` (#128745)

Convert `JoinablePath`, `ReadablePath` and `WritablePath` to real ABCs
derived from `abc.ABC`.

Make `JoinablePath.parser` abstract, rather than defaulting to `posixpath`.

Register `PurePath` and `Path` as virtual subclasses of the ABCs rather
than deriving. This avoids a hit to path object instantiation performance.

No change of behaviour in the public (non-abstract) classes.

8 months agogh-129989: Properly disable tailcall interp in configure (GH-129991)
Ken Jin [Sat, 15 Feb 2025 19:01:24 +0000 (03:01 +0800)] 
gh-129989: Properly disable tailcall interp in configure (GH-129991)

Co-authored-by: Zanie Blue <contact@zanie.dev>
8 months agogh-128345: properly disable gil for `_freeze_module.vcxproj` (#128344)
Julian Waters [Sat, 15 Feb 2025 14:05:54 +0000 (22:05 +0800)] 
gh-128345: properly disable gil for `_freeze_module.vcxproj` (#128344)

8 months agoAdd Neil's suggestions to whatsnew wording for tailcall (#130155)
Ken Jin [Sat, 15 Feb 2025 13:09:37 +0000 (21:09 +0800)] 
Add Neil's suggestions to whatsnew wording for tailcall (#130155)

Add Neil's suggestions

Co-authored-by: Neil Schemenauer <690853+nascheme@users.noreply.github.com>
8 months agogh-130145: fix `loop.run_forever` when loop is already running (#130146)
Kumar Aditya [Sat, 15 Feb 2025 09:31:53 +0000 (15:01 +0530)] 
gh-130145: fix `loop.run_forever` when loop is already running (#130146)

8 months agogh-129107: make `bytearray` thread safe (#129108)
Tomasz Pytel [Sat, 15 Feb 2025 07:19:42 +0000 (02:19 -0500)] 
gh-129107: make `bytearray` thread safe (#129108)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
8 months agogh-130106: Fix a typo in unittest.mock doc (#130107)
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) [Sat, 15 Feb 2025 03:30:12 +0000 (09:00 +0530)] 
gh-130106: Fix a typo in unittest.mock doc (#130107)

8 months agogh-130095: Mark `_py_abc` tests as not thread-safe (gh-130131)
Sam Gross [Fri, 14 Feb 2025 21:21:45 +0000 (16:21 -0500)] 
gh-130095: Mark `_py_abc` tests as not thread-safe (gh-130131)

The `_py_abc` implementation is not currently thread-safe (even with the GIL).
Don't run these tests with `--parallel-threads=N` for now.

8 months agogh-130123: Make __new__ wrapper be deferred (#130124)
Dino Viehland [Fri, 14 Feb 2025 20:50:54 +0000 (12:50 -0800)] 
gh-130123: Make __new__ wrapper be deferred (#130124)

Make __new__ wrapper be deferred

8 months agoDoc: update term "namespace package" (#129251)
Inada Naoki [Fri, 14 Feb 2025 18:47:54 +0000 (03:47 +0900)] 
Doc: update term "namespace package" (#129251)

8 months agogh-129173: Use `_PyUnicodeError_GetParams` in `PyCodec_SurrogatePassErrors` (GH-129134)
Bénédikt Tran [Fri, 14 Feb 2025 17:34:32 +0000 (18:34 +0100)] 
gh-129173: Use `_PyUnicodeError_GetParams` in `PyCodec_SurrogatePassErrors` (GH-129134)

8 months agogh-128703: Fix mimetypes.guess_type for empty Content-Type in registry (GH-128854)
RUANG (James Roy) [Fri, 14 Feb 2025 17:26:26 +0000 (01:26 +0800)] 
gh-128703: Fix mimetypes.guess_type for empty Content-Type in registry (GH-128854)

8 months agogh-82045: Correct and deduplicate "isprintable" docs; add test. (GH-130118)
Stan Ulbrych [Fri, 14 Feb 2025 17:16:47 +0000 (17:16 +0000)] 
gh-82045: Correct and deduplicate "isprintable" docs; add test. (GH-130118)

We had the definition of what makes a character "printable" documented in three places, giving two different definitions.
The definition in the comment on `_PyUnicode_IsPrintable` was inverted; correct that.

With that correction, the two definitions turn out to be equivalent -- but to confirm that, you have to go look up, or happen to know, that those are the only five "Other" categories and only three "Separator" categories in the Unicode character database.  That makes it hard for the reader to tell whether they really are the same, or if there's some subtle difference in the intended semantics.

Fix that by cutting the C API docs' and the C comment's copies of the subtle details, in favor of referring to the Python-level docs. That ensures it's explicit that these are all meant to agree, and also lets us concentrate improvements to the wording in one place.

Speaking of which, borrow some ideas from the C comment, along with other tweaks, to hopefully add a bit more clarity to that one newly-centralized copy in the docs.

Also add a thorough test that the implementation agrees with this definition.

Author:    Greg Price <gnprice@gmail.com>

Co-authored-by: Greg Price <gnprice@gmail.com>
8 months agoCorrect typo in GH-129623 (#130079)
Stefano Rivera [Fri, 14 Feb 2025 16:27:17 +0000 (08:27 -0800)] 
Correct typo in GH-129623 (#130079)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
8 months agoCI: Mark the `cross-build-linux` job as skippable (#130113)
Peter Bierma [Fri, 14 Feb 2025 14:46:04 +0000 (09:46 -0500)] 
CI: Mark the `cross-build-linux` job as skippable (#130113)

8 months agogh-126835: Set location for noped out instructions after constant folding in CFG...
Yan Yanchii [Fri, 14 Feb 2025 14:15:08 +0000 (15:15 +0100)] 
gh-126835: Set location for noped out instructions after constant folding in CFG. (#130109)

8 months agogh-107510: gettext: Remove unnecessary tests (GH-127965)
Tomas R. [Fri, 14 Feb 2025 12:16:10 +0000 (13:16 +0100)] 
gh-107510: gettext: Remove unnecessary tests (GH-127965)

There are now separate pygettext tests.

8 months agogh-129911: pygettext: Fix the keyword entry in help output (GH-129914)
Tomas R. [Fri, 14 Feb 2025 09:34:09 +0000 (10:34 +0100)] 
gh-129911: pygettext: Fix the keyword entry in help output (GH-129914)

8 months agogh-125331: Allow the parser to activate future imports on the fly (#125482)
Pablo Galindo Salgado [Fri, 14 Feb 2025 04:54:56 +0000 (04:54 +0000)] 
gh-125331: Allow the parser to activate future imports on the fly (#125482)

8 months agoGH-115869: Don't JIT zeroed bytes (GH-130023)
Brandt Bucher [Thu, 13 Feb 2025 18:51:03 +0000 (10:51 -0800)] 
GH-115869: Don't JIT zeroed bytes (GH-130023)

8 months agoFix a typo in `_localemodule.c` (GH-130085)
Bartosz Sławecki [Thu, 13 Feb 2025 17:29:26 +0000 (18:29 +0100)] 
Fix a typo in `_localemodule.c` (GH-130085)

8 months agogh-128130: Fix unhandled keyboard interrupt data race (gh-129975)
Sam Gross [Thu, 13 Feb 2025 17:29:03 +0000 (12:29 -0500)] 
gh-128130: Fix unhandled keyboard interrupt data race (gh-129975)

Use an atomic operation when setting
`_PyRuntime.signals.unhandled_keyboard_interrupt`. We now only clear the
variable at the start of `_PyRun_Main`, which is the same function where
we check it.

This avoids race conditions where previously another thread might call
`run_eval_code_obj()` and erroneously clear the unhandled keyboard
interrupt.

8 months agoRevert "gh-130048: Reintroduce full LTO as default on Clang (GH-130049)" (#130088)
Ken Jin [Thu, 13 Feb 2025 17:27:19 +0000 (01:27 +0800)] 
Revert "gh-130048: Reintroduce full LTO as default on Clang (GH-130049)" (#130088)

This reverts commit 34c06ccc4c6c21935b46302935f3df24b00daa2c.

8 months agogh-129984: Mark immortal objects as deferred (#129985)
Dino Viehland [Thu, 13 Feb 2025 17:01:43 +0000 (09:01 -0800)] 
gh-129984: Mark immortal objects as deferred (#129985)

Mark immortal objects as deferred

8 months agogh-130019: Fix data race in _PyType_AllocNoTrack (gh-130058)
Sam Gross [Thu, 13 Feb 2025 16:50:45 +0000 (11:50 -0500)] 
gh-130019: Fix data race in _PyType_AllocNoTrack (gh-130058)

The reference count fields, such as `ob_tid` and `ob_ref_shared`, may be
accessed concurrently in the free threading build by a `_Py_TryXGetRef`
or similar operation. The PyObject header fields will be initialized by
`_PyObject_Init`, so only call `memset()` to zero-initialize the remainder
of the allocation.

8 months agono-issue: Add free-threading build for TC dispatch (gh-130083)
Donghee Na [Thu, 13 Feb 2025 15:25:40 +0000 (00:25 +0900)] 
no-issue: Add free-threading build for TC dispatch (gh-130083)

no-issue: Add free-threading build for TCO dispatch

8 months agogh-130048: Reintroduce full LTO as default on Clang (GH-130049)
Ken Jin [Thu, 13 Feb 2025 14:06:00 +0000 (22:06 +0800)] 
gh-130048: Reintroduce full LTO as default on Clang (GH-130049)

8 months agoGH-107956: install build-details.json (PEP 739) (#130069)
Filipe Laíns 🇵🇸 [Thu, 13 Feb 2025 13:58:00 +0000 (13:58 +0000)] 
GH-107956: install build-details.json (PEP 739) (#130069)

8 months agogh-126835: Move const folding of lists & sets from ast_opt.c to flowgraph.c (#130032)
Yan Yanchii [Thu, 13 Feb 2025 12:11:07 +0000 (13:11 +0100)] 
gh-126835: Move const folding of lists & sets from ast_opt.c to flowgraph.c (#130032)

8 months agogh-128002: optimistically remove tasks from linked list when finished (#129995)
Kumar Aditya [Thu, 13 Feb 2025 07:49:53 +0000 (13:19 +0530)] 
gh-128002: optimistically remove tasks from linked list when finished  (#129995)

8 months agogh-130025: Correct handling of symlinks during iOS testbed framework installation...
Russell Keith-Magee [Thu, 13 Feb 2025 06:03:43 +0000 (14:03 +0800)] 
gh-130025: Correct handling of symlinks during iOS testbed framework installation. (#130026)

Correct handling of symlinks during iOS testbed framework installation.

8 months agoGH-127432: add cross-build-linux as a required CI job (#129459)
Filipe Laíns 🇵🇸 [Thu, 13 Feb 2025 02:41:13 +0000 (02:41 +0000)] 
GH-127432: add cross-build-linux as a required CI job (#129459)

8 months agogh-96092: Fix traceback.walk_stack(None) skipping too many frames (#129330)
Ammar Askar [Thu, 13 Feb 2025 01:43:09 +0000 (20:43 -0500)] 
gh-96092: Fix traceback.walk_stack(None) skipping too many frames (#129330)

As it says in its documentation, walk_stack was meant to just
follow `f.f_back` like other functions in the traceback module.
Instead it was previously doing `f.f_back.f_back` and then this
changed to `f_back.f_back.f_back.f_back' in Python 3.11 breaking
its behavior for external users.

This happened because the walk_stack function never really had
any good direct tests and its only consumer in the traceback module was
`extract_stack` which passed the result into `StackSummary.extract`.
As a generator, it was previously capturing the state of the stack
when it was first iterated over, rather than the stack when `walk_stack`
was called. Meaning when called inside the two method deep
`extract` and `extract_stack` calls, two `f_back`s were needed.
When 3.11 modified the sequence of calls in `extract`, two more
`f_back`s were needed to make the tests happy.

This changes the generator to capture the stack when `walk_stack` is
called, rather than when it is first iterated over. Since this is
technically a breaking change in behavior, there is a versionchanged
to the documentation. In practice, this is unlikely to break anyone,
you would have been needing to store the result of `walk_stack` and
expecting it to change.

8 months agogh-88535: Improve syntax error for wrongly closed strings (#26633)
Pablo Galindo Salgado [Thu, 13 Feb 2025 01:30:20 +0000 (01:30 +0000)] 
gh-88535: Improve syntax error for wrongly closed strings (#26633)

8 months agogh-116042: Fix location for SyntaxErrors of invalid escapes in the tokenizer (#116049)
Pablo Galindo Salgado [Thu, 13 Feb 2025 01:07:37 +0000 (01:07 +0000)] 
gh-116042: Fix location for SyntaxErrors of invalid escapes in the tokenizer (#116049)

8 months agoGH-91048: Correct error path in testexternalinspection (#129557)
Pablo Galindo Salgado [Thu, 13 Feb 2025 01:07:01 +0000 (01:07 +0000)] 
GH-91048: Correct error path in testexternalinspection (#129557)

8 months agogh-129693: Suppress `SyntaxWarning` in test_fstring (#129830)
Tomas R. [Thu, 13 Feb 2025 00:38:28 +0000 (01:38 +0100)] 
gh-129693: Suppress `SyntaxWarning` in test_fstring (#129830)

Suppress SyntaxWarning in test_fstring

8 months agogh-130030: Fix crash on 32-bit Linux with free threading (gh-130043)
Sam Gross [Wed, 12 Feb 2025 23:09:15 +0000 (18:09 -0500)] 
gh-130030: Fix crash on 32-bit Linux with free threading (gh-130043)

The `gc_get_refs` assertion needs to be after we check the alive and
unreachable bits. Otherwise, `ob_tid` may store the actual thread id
instead of the computed `gc_refs`, which may trigger the assertion if
the `ob_tid` looks like a negative value.

Also fix a few type warnings on 32-bit systems.

8 months ago gh-129912: Fix references to `Py_TPFLAGS_MANAGED_DICT` (gh-130044)
Satyam Kumar [Wed, 12 Feb 2025 22:48:14 +0000 (04:18 +0530)] 
 gh-129912: Fix references to `Py_TPFLAGS_MANAGED_DICT` (gh-130044)

8 months agogh-130050: Fix memory leaks in _testexternalinspection (#130051)
Sergey Miryanov [Wed, 12 Feb 2025 21:12:07 +0000 (13:12 -0800)] 
gh-130050: Fix memory leaks in _testexternalinspection (#130051)

8 months agogh-129819: Allow tier2/JIT and tailcall (GH-129820)
Ken Jin [Wed, 12 Feb 2025 18:18:36 +0000 (02:18 +0800)] 
gh-129819: Allow tier2/JIT and tailcall (GH-129820)

8 months agoGH-129715: Don't project traces that return to an unknown caller (GH-130024)
Brandt Bucher [Wed, 12 Feb 2025 18:16:43 +0000 (10:16 -0800)] 
GH-129715: Don't project traces that return to an unknown caller (GH-130024)

8 months agoGH-128682: Account for escapes in `DECREF_INPUTS` (GH-129953)
Mark Shannon [Wed, 12 Feb 2025 17:44:59 +0000 (17:44 +0000)] 
GH-128682: Account for escapes in `DECREF_INPUTS` (GH-129953)

* Handle escapes in DECREF_INPUTS

* Mark a few more functions as escaping

* Replace DECREF_INPUTS with PyStackRef_CLOSE where possible

8 months agogh-109798: Normalize `_datetime` and `datetime` error messages (#127345)
donBarbos [Wed, 12 Feb 2025 14:54:22 +0000 (18:54 +0400)] 
gh-109798: Normalize `_datetime` and `datetime` error messages (#127345)

Updates error messages in datetime and makes them consistent between Python and C.

---------

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
8 months agogh-128759: Fix accesses to `tp_version_tag`. (GH-129750)
Sam Gross [Wed, 12 Feb 2025 14:34:40 +0000 (09:34 -0500)] 
gh-128759: Fix accesses to `tp_version_tag`. (GH-129750)

We should use a relaxed atomic load in the free threading build in
`PyType_Modified()` because that's called without the type lock held.
It's not necessary to use atomics in `type_modified_unlocked()`.

We should also use `FT_ATOMIC_STORE_UINT_RELAXED()` instead of the
`UINT32` variant because `tp_version_tag` is declared as `unsigned int`.

8 months agogh-129983: fix data race in compile_template in sre.c (#130015)
Tomasz Pytel [Wed, 12 Feb 2025 13:04:44 +0000 (08:04 -0500)] 
gh-129983: fix data race in compile_template in sre.c (#130015)

8 months agogh-129889: Support context manager protocol by contextvars.Token (#129888)
Andrew Svetlov [Wed, 12 Feb 2025 11:32:58 +0000 (12:32 +0100)] 
gh-129889: Support context manager protocol by contextvars.Token (#129888)

8 months agoUpdate manpage environment variables and command line arguments (#129623)
Stefano Rivera [Wed, 12 Feb 2025 11:00:35 +0000 (03:00 -0800)] 
Update manpage environment variables and command line arguments (#129623)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
8 months agogh-59149: Setup documentation for IDLE on Linux and add section in Editors (#130003)
Stan Ulbrych [Wed, 12 Feb 2025 08:16:56 +0000 (08:16 +0000)] 
gh-59149: Setup documentation for IDLE on Linux and add section in Editors (#130003)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
---------

Co-authored-by: Petr Viktorin <encukou@gmail.com>
8 months agogh-128446: Skip Windows CI for Unix build system changes (#128450)
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) [Wed, 12 Feb 2025 01:53:29 +0000 (07:23 +0530)] 
gh-128446: Skip Windows CI for Unix build system changes (#128450)

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
8 months agogh-125746: Delay deprecated `zipimport.zipimporter.load_module` removal time to 3...
Wulian233 [Tue, 11 Feb 2025 23:59:09 +0000 (07:59 +0800)] 
gh-125746: Delay deprecated `zipimport.zipimporter.load_module` removal time to 3.15 (#125748)

8 months agogh-129967: Fix race condition in `repr(set)` (gh-129978)
Sam Gross [Tue, 11 Feb 2025 22:29:27 +0000 (17:29 -0500)] 
gh-129967: Fix race condition in `repr(set)` (gh-129978)

The call to `PySequence_List()` could temporarily unlock and relock the
set, allowing the items to be cleared and return the incorrect
notation `{}` for a empty set (it should be `set()`).

Co-authored-by: T. Wouters <thomas@python.org>
8 months agogh-128657: Skip test_get_builtin_constructor when running with --parallel-threads...
Sam Gross [Tue, 11 Feb 2025 21:59:36 +0000 (16:59 -0500)] 
gh-128657: Skip test_get_builtin_constructor when running with --parallel-threads (GH-130018)

The test modifies sys.modules and is not thread-safe.

8 months agogh-117657: Add test_thread_local_bytecode to TSAN tests (gh-129753)
Sam Gross [Tue, 11 Feb 2025 21:54:32 +0000 (16:54 -0500)] 
gh-117657: Add test_thread_local_bytecode to TSAN tests (gh-129753)

Skip `test_no_copies_if_tlbc_disabled` when run under TSAN for now
due to a data race on the adaptive counter (see gh-129752).

8 months agogh-117657: Enable test_opcache under TSAN (GH-129831)
Sam Gross [Tue, 11 Feb 2025 21:53:08 +0000 (16:53 -0500)] 
gh-117657: Enable test_opcache under TSAN (GH-129831)

Fix a few thread-safety bugs to enable test_opcache when run with TSAN:

 * Use relaxed atomics when clearing `ht->_spec_cache.getitem`
   (gh-115999)
 * Add temporary suppression for type slot modifications (gh-127266)
 * Use atomic load when reading `*dictptr`

8 months agoRemove trailing whitespace in Lib/pydoc_data/topics.py (#130014)
Sam Gross [Tue, 11 Feb 2025 21:28:28 +0000 (16:28 -0500)] 
Remove trailing whitespace in Lib/pydoc_data/topics.py (#130014)

8 months agogh-129244: Only remove the workaround when MSVC has the bugfix (#130011)
Michael Droettboom [Tue, 11 Feb 2025 19:49:42 +0000 (14:49 -0500)] 
gh-129244: Only remove the workaround when MSVC has the bugfix (#130011)

8 months agoMerge branch 'main' of https://github.com/python/cpython
Hugo van Kemenade [Tue, 11 Feb 2025 19:29:11 +0000 (21:29 +0200)] 
Merge branch 'main' of https://github.com/python/cpython

8 months agoPost 3.14.0a5
Hugo van Kemenade [Tue, 11 Feb 2025 19:26:52 +0000 (21:26 +0200)] 
Post 3.14.0a5

8 months agogh-97850: Update the deprecation warning of `importlib.abc.Loader.load_module` (GH...
Tomas R. [Tue, 11 Feb 2025 19:04:16 +0000 (20:04 +0100)] 
gh-97850: Update the deprecation warning of `importlib.abc.Loader.load_module` (GH-129855)

8 months agoPython 3.14.0a5 v3.14.0a5
Hugo van Kemenade [Tue, 11 Feb 2025 17:16:07 +0000 (19:16 +0200)] 
Python 3.14.0a5

8 months agogh-130004: Disable PGO for ceval.c on MSVC for default build (GH-130009)
Ken Jin [Tue, 11 Feb 2025 17:13:05 +0000 (01:13 +0800)] 
gh-130004: Disable PGO for ceval.c on MSVC for default build (GH-130009)

Disable PGO for ceval.c on MSVC on default build

8 months agogh-129980: Include test name in TSAN filename in multiprocess test runner (GH-129981)
Sam Gross [Tue, 11 Feb 2025 17:09:43 +0000 (12:09 -0500)] 
gh-129980: Include test name in TSAN filename in multiprocess test runner (GH-129981)