]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
9 months agoGH-128842: Collect JIT memory stats (GH-128941)
Diego Russo [Sun, 2 Feb 2025 23:17:53 +0000 (23:17 +0000)] 
GH-128842: Collect JIT memory stats (GH-128941)

9 months agoGH-128872: Remove unused argument from _PyCode_Quicken (GH-128873)
Yan Yanchii [Sun, 2 Feb 2025 23:09:30 +0000 (00:09 +0100)] 
GH-128872: Remove unused argument from _PyCode_Quicken (GH-128873)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
9 months agogh-105875: amend sqlite3 docstring wrt. SQLite requirement (#129599)
Erlend E. Aasland [Sun, 2 Feb 2025 23:03:54 +0000 (00:03 +0100)] 
gh-105875: amend sqlite3 docstring wrt. SQLite requirement (#129599)

9 months agogh-91417: Remove PySequence_Fast() from the limited C API (#129398)
Victor Stinner [Sun, 2 Feb 2025 22:17:30 +0000 (23:17 +0100)] 
gh-91417: Remove PySequence_Fast() from the limited C API (#129398)

The function never worked with the limited C API. It was added by
mistake.

9 months agoGH-121970: Extract ``misc_news`` into a new extension (#129577)
Adam Turner [Sun, 2 Feb 2025 16:17:02 +0000 (16:17 +0000)] 
GH-121970: Extract ``misc_news`` into a new extension (#129577)

9 months agogh-126609: Allow translating the ``availability`` directive (#129549)
Adam Turner [Sun, 2 Feb 2025 16:12:01 +0000 (16:12 +0000)] 
gh-126609: Allow translating the ``availability`` directive (#129549)

9 months agogh-115514: Fix incomplete writes after close while using ssl in asyncio(#128037)
Vojtěch Boček [Sun, 2 Feb 2025 15:11:25 +0000 (16:11 +0100)] 
gh-115514: Fix incomplete writes after close while using ssl in asyncio(#128037)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
9 months agoRevert "gh-129005: Align FileIO.readall() allocation (#129458)" (#129572)
Cody Maloney [Sun, 2 Feb 2025 14:59:15 +0000 (06:59 -0800)] 
Revert "gh-129005: Align FileIO.readall() allocation (#129458)" (#129572)

This reverts commit f927204f64b3f8dbecec784e05bc8e25d2a78b2e.

9 months agogh-104400: Remove ``fintl.gettext`` from pygettext (#129580)
Adam Turner [Sun, 2 Feb 2025 14:30:34 +0000 (14:30 +0000)] 
gh-104400: Remove ``fintl.gettext`` from pygettext (#129580)

The ``fintl`` module is never installed or tested, meaning that the
fallback identity function is unconditionally used for ``_()``.
This means we can simplify, converting the docstring to a real
docstring, and converting some other strings to f-strings.

We also convert the module to UTF-8, sort imports,
and remove the history comment, which was last updated in 2002.
Consult the git history for a more accurate summary of changes.

9 months agogh-129539: Reorganize posixmodule.c header (#129558)
Victor Stinner [Sun, 2 Feb 2025 09:16:48 +0000 (10:16 +0100)] 
gh-129539: Reorganize posixmodule.c header (#129558)

Add sections: Python includes, system includes, etc.

Add a comment explaining why an include is needed.

9 months agogh-119461: Restore the testSocket VSOCK skipUnless removed by PR #119465 (#129561)
Gregory P. Smith [Sun, 2 Feb 2025 04:46:56 +0000 (20:46 -0800)] 
gh-119461: Restore the testSocket VSOCK skipUnless removed by PR #119465 (#129561)

Restore the skipUnless removed by #119465.

This test can only pass on virtual machines, not actual machines.

actual machines see:

```
    self.cli.connect((cid, VSOCKPORT))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: [Errno 19] No such device
```

Reproduced on (Linux) Ubuntu 24.04.1 running 6.8.0-52-generic.

9 months agogh-126022: Replace TeX quotation marks with ``"`` in Doc/license.rst (#129535)
Stan Ulbrych [Sat, 1 Feb 2025 16:49:45 +0000 (16:49 +0000)] 
gh-126022: Replace TeX quotation marks with ``"`` in  Doc/license.rst (#129535)

9 months agogh-93649: Move _testcapi tests to specific files (#129544)
Victor Stinner [Sat, 1 Feb 2025 12:39:16 +0000 (13:39 +0100)] 
gh-93649: Move _testcapi tests to specific files (#129544)

Move many functions from _testcapimodule.c into more specific files
in Modules/_testcapi/.

In moved code:

* Replace get_testerror() with PyExc_AssertionError.
* Replace raiseTestError() with
  PyErr_Format(PyExc_AssertionError, ...).

9 months agogh-126835: Move optimization of constant sequence creation from codegen to CFG (...
Kirill Podoprigora [Sat, 1 Feb 2025 11:39:44 +0000 (11:39 +0000)] 
gh-126835: Move optimization of constant sequence creation from codegen to CFG (#129426)

Codegen phase has an optimization that transforms
```
LOAD_CONST x
LOAD_CONST y
LOAD_CONXT z
BUILD_LIST/BUILD_SET (3)
```
->
```
BUILD_LIST/BUILD_SET (0)
LOAD_CONST (x, y, z)
LIST_EXTEND/SET_UPDATE 1
```
This optimization has now been moved to CFG phase to make #128802 work.

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Yan Yanchii <yyanchiy@gmail.com>
9 months agogh-105704: Disallow square brackets (`[` and `]`) in domain names for parsed URLs...
Seth Michael Larson [Fri, 31 Jan 2025 17:41:34 +0000 (11:41 -0600)] 
gh-105704: Disallow square brackets (`[` and `]`) in domain names for parsed URLs (#129418)

* gh-105704: Disallow square brackets ( and ) in domain names for parsed URLs

* Use Sphinx references

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* Add mismatched bracket test cases, fix news format

* Add more test coverage for ports

---------

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
9 months agoGH-128563: Move some labels, to simplify implementing tailcalling interpreter. (GH...
Mark Shannon [Fri, 31 Jan 2025 17:13:20 +0000 (17:13 +0000)] 
GH-128563: Move some labels, to simplify implementing tailcalling interpreter. (GH-129525)

9 months agogh-128509: Add `sys._is_immortal` for identifying immortal objects (#128510)
Peter Bierma [Fri, 31 Jan 2025 15:27:08 +0000 (10:27 -0500)] 
gh-128509: Add `sys._is_immortal` for identifying immortal objects (#128510)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
9 months agogh-93649: Add Modules/_testcapi/function.c file (#129521)
Victor Stinner [Fri, 31 Jan 2025 15:02:50 +0000 (16:02 +0100)] 
gh-93649: Add Modules/_testcapi/function.c file (#129521)

* Move PyFunction C API tests to a new file.
* Add Lib/test/test_capi/test_function.py.
* Move tests from test_capi.test_misc to test_capi.test_function.

9 months agogh-126108: Fix potential null pointer dereference in `PySys_AddWarnOptionUnicode...
Valery Fedorenko [Fri, 31 Jan 2025 14:36:30 +0000 (22:36 +0800)] 
gh-126108: Fix potential null pointer dereference in `PySys_AddWarnOptionUnicode` (#126118)

9 months agogh-129430: Make walking vm regions more efficient in MacOS (#129494)
Pablo Galindo Salgado [Fri, 31 Jan 2025 14:08:48 +0000 (14:08 +0000)] 
gh-129430: Make walking vm regions more efficient in MacOS (#129494)

9 months agogh-129354: Use PyErr_FormatUnraisable() function (#129518)
Victor Stinner [Fri, 31 Jan 2025 14:06:14 +0000 (15:06 +0100)] 
gh-129354: Use PyErr_FormatUnraisable() function (#129518)

Replace PyErr_WriteUnraisable() with PyErr_FormatUnraisable().

9 months agogh-93649: Add Modules/_testcapi/type.c file (#129516)
Victor Stinner [Fri, 31 Jan 2025 14:03:54 +0000 (15:03 +0100)] 
gh-93649: Add Modules/_testcapi/type.c file (#129516)

Move PyType C API tests to a new file.

Move following tests from test_capi.test_misc to test_capi.test_type:

* BuiltinStaticTypesTests
* test_get_type_name()
* test_get_base_by_token()

9 months agogh-111178: fix UBSan failures in `Modules/_sqlite` (GH-129087)
Bénédikt Tran [Fri, 31 Jan 2025 13:33:30 +0000 (14:33 +0100)] 
gh-111178: fix UBSan failures in `Modules/_sqlite` (GH-129087)

* fix UBSan failures for `pysqlite_Blob`
* fix UBSan failures for `pysqlite_Connection`
* fix UBSan failures for `pysqlite_Cursor`
* fix UBSan failures for `pysqlite_PrepareProtocol`
* fix UBSan failures for `pysqlite_Row`
* fix UBSan failures for `pysqlite_Statement`

* suppress unused return values

9 months agogh-129502: Fix handling errors in ctypes callbacks (GH-129504)
Serhiy Storchaka [Fri, 31 Jan 2025 13:30:19 +0000 (15:30 +0200)] 
gh-129502: Fix handling errors in ctypes callbacks (GH-129504)

Unlikely errors in preparing arguments for ctypes callback are now
handled in the same way as errors raised in the callback of in converting
the result of the callback -- using sys.unraisablehook() instead of
sys.excepthook() and not setting sys.last_exc and other variables.

9 months agogh-129354: Use PyErr_FormatUnraisable() function (#129514)
Victor Stinner [Fri, 31 Jan 2025 13:20:35 +0000 (14:20 +0100)] 
gh-129354: Use PyErr_FormatUnraisable() function (#129514)

Replace PyErr_WriteUnraisable() with PyErr_FormatUnraisable().

9 months agogh-93649: Move PyFrame C API tests to test_capi (#129512)
Victor Stinner [Fri, 31 Jan 2025 12:51:58 +0000 (13:51 +0100)] 
gh-93649: Move PyFrame C API tests to test_capi (#129512)

* Add Lib/test/test_capi/test_frame.py file.
* Move C API tests from test_frame to test_capi.test_frame.
* Add Modules/_testcapi/frame.c file.
* Move C API tests from _testcapimodule.c to frame.c

9 months agogh-71494: string.Formatter: support keys/attributes in unnumbered fields (GH-21767)
qm2k [Fri, 31 Jan 2025 12:16:24 +0000 (12:16 +0000)] 
gh-71494: string.Formatter: support keys/attributes in unnumbered fields (GH-21767)

9 months agogh-129354: Use PyErr_FormatUnraisable() function (#129511)
Victor Stinner [Fri, 31 Jan 2025 12:16:08 +0000 (13:16 +0100)] 
gh-129354: Use PyErr_FormatUnraisable() function (#129511)

Replace PyErr_WriteUnraisable() with PyErr_FormatUnraisable().

9 months agoGH-128563: Simplify recursion check in `_PyEval_EvalFrameDefault` (GH-129481)
Mark Shannon [Fri, 31 Jan 2025 12:12:24 +0000 (12:12 +0000)] 
GH-128563: Simplify recursion check in `_PyEval_EvalFrameDefault` (GH-129481)

Simplify recursion check in _PyEval_EvalFrameDefault

9 months agoGH-128469: Revert "warn when libpython was loaded from outside the build directory...
Petr Viktorin [Fri, 31 Jan 2025 11:17:37 +0000 (12:17 +0100)] 
GH-128469: Revert "warn when libpython was loaded from outside the build directory (#128645)" (#129506)

9 months agoGH-129386: Add `test.support.reset_code` (GH-129486)
Brandt Bucher [Fri, 31 Jan 2025 10:50:54 +0000 (02:50 -0800)] 
GH-129386: Add `test.support.reset_code` (GH-129486)

9 months agogh-129393: Make 'sys.platform' return "freebsd" only on FreeBSD (#129394)
Michael Osipov [Fri, 31 Jan 2025 09:02:45 +0000 (10:02 +0100)] 
gh-129393: Make 'sys.platform' return "freebsd" only on FreeBSD (#129394)

Make 'sys.platform' return "freebsd" only on FreeBSD without major version.

9 months agogh-127975: Avoid reusing quote types in ast.unparse if not needed (#127980)
Shantanu [Fri, 31 Jan 2025 08:49:06 +0000 (00:49 -0800)] 
gh-127975: Avoid reusing quote types in ast.unparse if not needed (#127980)

9 months agogh-129354: Fix grammar in PyErr_FormatUnraisable() (#129475)
Victor Stinner [Fri, 31 Jan 2025 08:45:35 +0000 (09:45 +0100)] 
gh-129354: Fix grammar in PyErr_FormatUnraisable() (#129475)

Replace "on verb+ing" with "while verb+ing".

9 months agoRevert "gh-129005: _pyio.BufferedIO remove copy on readall (#129454)" (#129500)
Cody Maloney [Fri, 31 Jan 2025 08:40:44 +0000 (00:40 -0800)] 
Revert "gh-129005: _pyio.BufferedIO remove copy on readall (#129454)" (#129500)

This reverts commit e1c4ba928852eac0b0e0bded1c314e3e36975286.

9 months agogh-128452: fix warning in socketmodule.c (#129478)
Kumar Aditya [Fri, 31 Jan 2025 08:11:11 +0000 (13:41 +0530)] 
gh-128452: fix warning in socketmodule.c (#129478)

9 months agogh-129205: Update multiprocessing.forkserver to use os.readinto() (#129425)
Cody Maloney [Thu, 30 Jan 2025 22:24:52 +0000 (14:24 -0800)] 
gh-129205: Update multiprocessing.forkserver to use os.readinto() (#129425)

9 months agogh-127349: Add check for correct resizing in REPL (#127387)
donBarbos [Thu, 30 Jan 2025 19:34:09 +0000 (19:34 +0000)] 
gh-127349: Add check for correct resizing in REPL (#127387)

9 months agogh-111495: Add PyFile tests (#129449)
Victor Stinner [Thu, 30 Jan 2025 17:05:32 +0000 (18:05 +0100)] 
gh-111495: Add PyFile tests (#129449)

Add tests for the following functions in test_capi.test_file:

* PyFile_FromFd()
* PyFile_GetLine()
* PyFile_NewStdPrinter()
* PyFile_WriteObject()
* PyFile_WriteString()
* PyObject_AsFileDescriptor()

Add Modules/_testlimitedcapi/file.c file.

Remove test_embed.StdPrinterTests which became redundant.

9 months agogh-129354: Use PyErr_FormatUnraisable() function (#129435)
Victor Stinner [Thu, 30 Jan 2025 15:09:38 +0000 (16:09 +0100)] 
gh-129354: Use PyErr_FormatUnraisable() function (#129435)

Replace PyErr_WriteUnraisable() with PyErr_FormatUnraisable().

9 months agoclearer error and suggestion when c-analyzer cannot read ignored.tsv (#129423)
Irit Katriel [Thu, 30 Jan 2025 11:38:52 +0000 (11:38 +0000)] 
clearer error and suggestion when c-analyzer cannot read ignored.tsv (#129423)

9 months agogh-89188: Implement PyUnicode_KIND() as a function (#129412)
Victor Stinner [Thu, 30 Jan 2025 11:27:27 +0000 (12:27 +0100)] 
gh-89188: Implement PyUnicode_KIND() as a function (#129412)

Implement PyUnicode_KIND() and PyUnicode_DATA() as function, in
addition to the macros with the same names. The macros rely on C bit
fields which have compiler-specific layout.

9 months agogh-129005: _pyio.BufferedIO remove copy on readall (#129454)
Cody Maloney [Thu, 30 Jan 2025 11:23:25 +0000 (03:23 -0800)] 
gh-129005: _pyio.BufferedIO remove copy on readall (#129454)

Slicing buf and appending chunk would always result in a copy. Commonly
in a readall() there is no already read data in buf, and the amount of
data read may be large, so the copy is expensive.

9 months agogh-128911: Add PyImport_ImportModuleAttr() function (#128912)
Victor Stinner [Thu, 30 Jan 2025 11:17:29 +0000 (12:17 +0100)] 
gh-128911: Add PyImport_ImportModuleAttr() function (#128912)

Add PyImport_ImportModuleAttr() and
PyImport_ImportModuleAttrString() functions.

* Add unit tests.
* Replace _PyImport_GetModuleAttr()
  with PyImport_ImportModuleAttr().
* Replace _PyImport_GetModuleAttrString()
  with PyImport_ImportModuleAttrString().
* Remove "pycore_import.h" includes, no longer needed.

9 months agogh-129005: Align FileIO.readall() allocation (#129458)
Cody Maloney [Thu, 30 Jan 2025 11:14:23 +0000 (03:14 -0800)] 
gh-129005: Align FileIO.readall() allocation (#129458)

Both now use a pre-allocated buffer of length `bufsize`, fill it using
a readinto(), and have matching "expand buffer" logic.

On my machine this takes:

`./python -m test -M8g -uall test_largefile -m test_large_read -v`

from ~3.7 seconds to ~3.4 seconds.

9 months agogh-129467: Fix compiler warning in mpdecimal word_to_string() (#116346)
Sergey B Kirpichev [Thu, 30 Jan 2025 10:57:55 +0000 (13:57 +0300)] 
gh-129467: Fix compiler warning in mpdecimal word_to_string() (#116346)

Turn off false-positive -Wstringop-overflow in word_to_string().

9 months agogh-129438: Update ``--enable-experimental-jit`` section with install requirements...
Stan Ulbrych [Thu, 30 Jan 2025 10:16:05 +0000 (10:16 +0000)] 
gh-129438: Update ``--enable-experimental-jit`` section with install requirements (#129450)

Add a note to the `JIT` docs that building CPython with `JIT` requires Python 3.11 or newer.

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
9 months agogh-111178: fix UBSan failures in `Modules/_ssl/cert.c` (GH-129088)
Bénédikt Tran [Thu, 30 Jan 2025 10:11:37 +0000 (11:11 +0100)] 
gh-111178: fix UBSan failures in `Modules/_ssl/cert.c` (GH-129088)

fix UBSan failures for `PySSLCertificate`

9 months agoremove type annotations from multiprocessing. (#129381)
Gregory P. Smith [Thu, 30 Jan 2025 08:31:54 +0000 (00:31 -0800)] 
remove type annotations from multiprocessing. (#129381)

* remove type annotations from multiprocessing.

One of them was technically invalid per typing specs... but since we're not
checking these in the stdlib today lets elide them.

https://discuss.python.org/t/static-type-annotations-in-cpython/65068/13

* use the actual comment style annotation format

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
---------

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
9 months agogh-129403: Fix `ValueError` messages in `asyncio.Barrier` and `threading.Barrier...
Stan Ulbrych [Thu, 30 Jan 2025 08:11:12 +0000 (08:11 +0000)] 
gh-129403: Fix `ValueError` messages in `asyncio.Barrier` and `threading.Barrier` (#129419)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
9 months agotests: add test.support.venv.VirtualEnvironmentMixin (#129461)
Filipe Laíns 🇵🇸 [Thu, 30 Jan 2025 03:32:24 +0000 (03:32 +0000)] 
tests: add test.support.venv.VirtualEnvironmentMixin (#129461)

9 months agogh-128779: Fix site venv() for system site-packages (#129184)
Victor Stinner [Thu, 30 Jan 2025 00:02:31 +0000 (01:02 +0100)] 
gh-128779: Fix site venv() for system site-packages (#129184)

9 months agogh-127432: Add CI job to cross build Python (#128380)
Matthew Hughes [Wed, 29 Jan 2025 23:24:09 +0000 (23:24 +0000)] 
gh-127432: Add CI job to cross build Python (#128380)

Co-authored-by: Filipe Laíns 🇵🇸 <lains@riseup.net>
9 months agoGH-127178: improve compatibility in `_sysconfig_vars_(...).json` (#128558)
Filipe Laíns 🇵🇸 [Wed, 29 Jan 2025 22:47:20 +0000 (22:47 +0000)] 
GH-127178: improve compatibility in `_sysconfig_vars_(...).json` (#128558)

9 months agoGH-128469: warn when libpython was loaded from outside the build directory (#128645)
Filipe Laíns 🇵🇸 [Wed, 29 Jan 2025 22:35:55 +0000 (22:35 +0000)] 
GH-128469: warn when libpython was loaded from outside the build directory (#128645)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
9 months agogh-125522: Fix bare except in `test_uuid` (#129018)
Tomas R. [Wed, 29 Jan 2025 20:59:45 +0000 (21:59 +0100)] 
gh-125522: Fix bare except in `test_uuid` (#129018)

9 months agogh-126400: Add TCP socket timeout to SysLogHandler to prevent blocking (GH-126716)
Hod [Wed, 29 Jan 2025 19:37:43 +0000 (21:37 +0200)] 
gh-126400: Add TCP socket timeout to SysLogHandler to prevent blocking (GH-126716)

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
9 months agoGH-129386: Use symbolic constants for specialization tests (GH-129415)
Brandt Bucher [Wed, 29 Jan 2025 18:49:58 +0000 (10:49 -0800)] 
GH-129386: Use symbolic constants for specialization tests (GH-129415)

9 months agogh-118761: Always lazy import `warnings` in `threading` (#129428)
Taneli Hukkinen [Wed, 29 Jan 2025 17:24:37 +0000 (19:24 +0200)] 
gh-118761: Always lazy import `warnings` in `threading` (#129428)

9 months agogh-118761: Improve import time of `subprocess` (GH-129427)
Taneli Hukkinen [Wed, 29 Jan 2025 16:31:13 +0000 (18:31 +0200)] 
gh-118761: Improve import time of `subprocess` (GH-129427)

* subprocess: lazy import signal and locale to improve module import time

9 months agogh-129236: Use `stackpointer` in free threaded GC (#129240)
Sam Gross [Wed, 29 Jan 2025 15:40:51 +0000 (10:40 -0500)] 
gh-129236: Use `stackpointer` in free threaded GC (#129240)

The stack pointers in interpreter frames are nearly always valid now, so
use them when visiting each thread's frame. For now, don't collect
objects with deferred references in the rare case that we see a frame
with a NULL stack pointer.

9 months agogh-127119: Faster check for small ints in long_dealloc (GH-127620)
Pieter Eendebak [Wed, 29 Jan 2025 15:22:18 +0000 (16:22 +0100)] 
gh-127119: Faster check for small ints in long_dealloc (GH-127620)

9 months agogh-129296: Fix `pyatomic.h` include paths (#129320)
Zanie Blue [Wed, 29 Jan 2025 15:06:19 +0000 (09:06 -0600)] 
gh-129296: Fix `pyatomic.h` include paths (#129320)

Use relative includes in Include/cpython/pyatomic.h for
pyatomic_gcc.h, pyatomic_std.h and pyatomic_msc.h.

Do a similar change in Include/cpython/pythread.h for
pthread_stubs.h include.

9 months agogh-129345: null check for indent syslogmodule (#129348)
Burkov Egor [Wed, 29 Jan 2025 13:49:23 +0000 (16:49 +0300)] 
gh-129345: null check for indent syslogmodule (#129348)

9 months agoCI: Change job name to 'build arm64' on Windows (#129434)
Hugo van Kemenade [Wed, 29 Jan 2025 13:18:19 +0000 (15:18 +0200)] 
CI: Change job name to 'build arm64' on Windows (#129434)

9 months agogh-129409: Fix Integer overflow - SEGV while writing data more than 2GB in CSV file...
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) [Wed, 29 Jan 2025 11:15:47 +0000 (16:45 +0530)] 
gh-129409: Fix Integer overflow -  SEGV while writing data more than 2GB in CSV file (#129413)

9 months agogh-100239: specialize bitwise logical binary ops on ints (#128927)
Irit Katriel [Wed, 29 Jan 2025 09:28:21 +0000 (09:28 +0000)] 
gh-100239: specialize bitwise logical binary ops on ints (#128927)

9 months agoMerge TSAN test matrices in CI (#123278)
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) [Wed, 29 Jan 2025 09:16:51 +0000 (10:16 +0100)] 
Merge TSAN test matrices in CI (#123278)

9 months agogh-126703: Add freelists for list and tuple iterators (GH-128592)
Pieter Eendebak [Wed, 29 Jan 2025 09:15:24 +0000 (10:15 +0100)] 
gh-126703: Add freelists for list and tuple iterators (GH-128592)

9 months agoGH-128563: Don't leave frame->lltrace uninitialized (GH-129417)
Brandt Bucher [Wed, 29 Jan 2025 00:26:46 +0000 (16:26 -0800)] 
GH-128563: Don't leave frame->lltrace uninitialized (GH-129417)

9 months agoGH-126599: Remove the PyOptimizer API (GH-129194)
Brandt Bucher [Wed, 29 Jan 2025 00:10:51 +0000 (16:10 -0800)] 
GH-126599: Remove the PyOptimizer API (GH-129194)

9 months agogh-115999: Enable free-threaded specialization of LOAD_CONST (#129365)
T. Wouters [Wed, 29 Jan 2025 00:07:56 +0000 (01:07 +0100)] 
gh-115999: Enable free-threaded specialization of LOAD_CONST (#129365)

Enable free-threaded specialization of LOAD_CONST.

9 months agogh-127146: Skip test_readinto_non_blocking on Emscripten (#129421)
Hood Chatham [Tue, 28 Jan 2025 23:30:42 +0000 (23:30 +0000)] 
gh-127146: Skip test_readinto_non_blocking on Emscripten (#129421)

Skips an additional test due to non_blocking not working reliably on Emscripten.

9 months agogh-112075: Remove critical section in dict.get (gh-129336)
Pieter Eendebak [Tue, 28 Jan 2025 21:55:45 +0000 (22:55 +0100)] 
gh-112075: Remove critical section in dict.get (gh-129336)

The `dict.get` implementation uses `_Py_dict_lookup_threadsafe`, which is
thread-safe, so we remove the critical section from the argument clinic.

Add a test for concurrent dict get and set operations.

9 months agoGH-127381: pathlib ABCs: remove `JoinablePath.match()` (#129147)
Barney Gale [Tue, 28 Jan 2025 20:22:55 +0000 (20:22 +0000)] 
GH-127381: pathlib ABCs: remove `JoinablePath.match()` (#129147)

Unlike `ReadablePath.[r]glob()` and `JoinablePath.full_match()`, the
`JoinablePath.match()` method doesn't support the recursive wildcard `**`,
and matches from the right when a fully relative pattern is given. These
quirks means its probably unsuitable for inclusion in the pathlib ABCs,
especially given `full_match()` handles the same use case.

9 months agogh-128844: Make `_Py_TryIncref` public as an unstable API. (#128926)
Sam Gross [Tue, 28 Jan 2025 19:32:27 +0000 (14:32 -0500)] 
gh-128844: Make `_Py_TryIncref` public as an unstable API. (#128926)

This exposes `_Py_TryIncref` as `PyUnstable_TryIncref()` and the helper
function `_PyObject_SetMaybeWeakref` as `PyUnstable_EnableTryIncRef`.

These are helpers for dealing with unowned references in a safe way,
particularly in the free threading build.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
9 months agogh-129408: http: Fix typo 'RFF' to RFC' in documentation (#129411)
Samuel GIFFARD [Tue, 28 Jan 2025 18:25:51 +0000 (19:25 +0100)] 
gh-129408: http: Fix typo 'RFF' to RFC' in documentation (#129411)

9 months agogh-129005: Avoid copy in _pyio.FileIO.readinto() (#129324)
Cody Maloney [Tue, 28 Jan 2025 11:40:44 +0000 (03:40 -0800)] 
gh-129005: Avoid copy in _pyio.FileIO.readinto() (#129324)

`os.read()` allocated and filled a buffer by calling `read(2)`, than that
data was copied into the user provied buffer. Read directly into the
caller's buffer instead by using `os.readinto()`.

`os.readinto()` uses `PyObject_GetBuffer()` to make sure the passed
in buffer is writeable and bytes-like, drop the manual check.

9 months agogh-112064: Fix incorrect handling of negative read sizes in `HTTPResponse.read()...
Yury Manushkin [Tue, 28 Jan 2025 11:37:32 +0000 (12:37 +0100)] 
gh-112064: Fix incorrect handling of negative read sizes in `HTTPResponse.read()` (#128270)

The parameter `amt` of `HTTPResponse.read()`, which could be a negative integer,
has not been handled before and led to waiting for the connection to close
for `keep-alive connections`. Now, this has been fixed, and passing negative values
to `HTTPResponse().read()` works the same as passing `None` value.

9 months agogh-127146: Update test skips for Emscripten 4.0.1 (#129375)
Hood Chatham [Tue, 28 Jan 2025 01:05:21 +0000 (01:05 +0000)] 
gh-127146: Update test skips for Emscripten 4.0.1 (#129375)

Updates the Emscripten test skips to reflect recent changes in Emscripten capabilities.

9 months agogh-85046: Document errno constants (#126420)
RUANG (James Roy) [Tue, 28 Jan 2025 00:12:45 +0000 (08:12 +0800)] 
gh-85046: Document errno constants (#126420)

9 months agogh-129346: Handle allocation errors for SQLite aggregate context (#129347)
Erlend E. Aasland [Mon, 27 Jan 2025 17:16:19 +0000 (18:16 +0100)] 
gh-129346: Handle allocation errors for SQLite aggregate context (#129347)

9 months agogh-128954: Reorder _PyInterpreterFrame fields for reduced memory usage (#128958)
Sam Gross [Mon, 27 Jan 2025 17:14:51 +0000 (12:14 -0500)] 
gh-128954: Reorder _PyInterpreterFrame fields for reduced memory usage (#128958)

This reduces the size of _PyInterpreterFrame by 8 bytes on 64-bit
platforms using the free threading build due to alignment requirements.

This allows for slightly more recursive calls into the interpreter (from
C), but `test_call.test_super_deep` still crashes.

9 months agogh-129205: Modernize test_eintr (#129316)
Victor Stinner [Mon, 27 Jan 2025 17:04:45 +0000 (18:04 +0100)] 
gh-129205: Modernize test_eintr (#129316)

* Use f-string.
* Fix grammar: replace 'datas' with 'data' (and replace 'data' with
  'item').
* Remove unused variables: 'pid' and 'old_mask'.
* Factorize test_read() and test_readinto() code.

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
9 months agoGH-128914: Remove all but one conditional stack effects (GH-129226)
Mark Shannon [Mon, 27 Jan 2025 16:24:48 +0000 (16:24 +0000)] 
GH-128914: Remove all but one conditional stack effects (GH-129226)

* Remove all 'if (0)' and 'if (1)' conditional stack effects

* Use array instead of conditional for BUILD_SLICE args

* Refactor LOAD_GLOBAL to use a common conditional uop

* Remove conditional stack effects from LOAD_ATTR specializations

* Replace conditional stack effects in LOAD_ATTR with a 0 or 1 sized array.

* Remove conditional stack effects from CALL_FUNCTION_EX

9 months agogh-128427: Add `uuid.NIL` and `uuid.MAX` (#128429)
Nick Pope [Mon, 27 Jan 2025 16:17:17 +0000 (16:17 +0000)] 
gh-128427: Add `uuid.NIL` and `uuid.MAX` (#128429)

9 months agoCleanup What's New in Python 3.14 (C API changes) (#129341)
Victor Stinner [Mon, 27 Jan 2025 15:06:07 +0000 (16:06 +0100)] 
Cleanup What's New in Python 3.14 (C API changes) (#129341)

* Document PyDictObject.ma_version_tag removal.
* Add "Limited C API Changes" section.
* Move entries from New Features to Porting to Python 3.14.
* Include Pending removal documents at the right place.

9 months agogh-119786: Fix small typo in AST to CFG to bytecode section in compiler.md (#129322)
Sergey Miryanov [Mon, 27 Jan 2025 14:36:09 +0000 (06:36 -0800)] 
gh-119786: Fix small typo in AST to CFG to bytecode section in compiler.md (#129322)

9 months agogh-129061: Fix `FORCE_COLOR` and `NO_COLOR` when empty strings (#129140)
Hugo van Kemenade [Mon, 27 Jan 2025 14:24:10 +0000 (16:24 +0200)] 
gh-129061: Fix `FORCE_COLOR` and `NO_COLOR` when empty strings (#129140)

9 months agogh-111178: fix UBSan failures in `Modules/_decimal` (GH-129074)
Bénédikt Tran [Mon, 27 Jan 2025 14:15:42 +0000 (15:15 +0100)] 
gh-111178: fix UBSan failures in `Modules/_decimal` (GH-129074)

* Introduce & use cast macros
* fix UBSan failures for `PyDecContextObject`
* fix UBSan failures for `PyDecContextManagerObject`
* remove redundant casts for `PyDecObject`

9 months agogh-111178: fix UBSan failures in `Python/traceback.c` (GH-128259)
Bénédikt Tran [Mon, 27 Jan 2025 14:07:39 +0000 (15:07 +0100)] 
gh-111178: fix UBSan failures in `Python/traceback.c` (GH-128259)

9 months agogh-111178: fix UBSan failures in `Modules/socketmodule.c` (GH-128249)
Bénédikt Tran [Mon, 27 Jan 2025 14:06:10 +0000 (15:06 +0100)] 
gh-111178: fix UBSan failures in `Modules/socketmodule.c` (GH-128249)

9 months agogh-111178: fix UBSan failures in `Modules/{blake2,md5,sha1,sha2,sha3}module.c` (GH...
Bénédikt Tran [Mon, 27 Jan 2025 13:50:58 +0000 (14:50 +0100)] 
gh-111178: fix UBSan failures in `Modules/{blake2,md5,sha1,sha2,sha3}module.c` (GH-128248)

- fix UBSan failures in `blake2module.c`
- fix UBSan failures in `md5module.c`
- fix UBSan failures in `sha1module.c`
- fix UBSan failures in `sha2module.c`
- fix UBSan failures in `sha3module.c`

Cosmetics:

- suppress unused return values
- remove redundant casts in constructors
- suppress unused parameters in `{md5,sha*,blake2}module.c`

9 months agogh-119511: Fix a potential denial of service in imaplib (#119514)
Serhiy Storchaka [Mon, 27 Jan 2025 13:44:00 +0000 (15:44 +0200)] 
gh-119511: Fix a potential denial of service in imaplib (#119514)

The IMAP4 client could consume an arbitrary amount of memory when trying
to connect to a malicious server, because it read a "literal" data with a
single read(size) call, and BufferedReader.read() allocates the bytes
object of the specified size before reading. Now the IMAP4 client reads data
by chunks, therefore the amount of used memory is limited by the
amount of the data actually been sent by the server.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
9 months agogh-128509: Add `PyUnstable_IsImmortal` for finding immortal objects (GH-129182)
Peter Bierma [Mon, 27 Jan 2025 13:36:33 +0000 (08:36 -0500)] 
gh-128509: Add `PyUnstable_IsImmortal` for finding immortal objects (GH-129182)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
9 months agogh-102471: Change PyLongWriter_Discard(NULL) to do nothing (#129339)
Victor Stinner [Mon, 27 Jan 2025 10:51:16 +0000 (11:51 +0100)] 
gh-102471: Change PyLongWriter_Discard(NULL) to do nothing (#129339)

It's convenient to be able to call PyLongWriter_Discard(NULL) in
error handling code.

9 months agogh-102471: Credit Sergey B Kirpichev for PEP 757 (#129338)
Victor Stinner [Mon, 27 Jan 2025 10:44:13 +0000 (11:44 +0100)] 
gh-102471: Credit Sergey B Kirpichev for PEP 757 (#129338)

9 months agogh-128563: Move labels in ceval.c to bytecodes.c (GH-129112)
Ken Jin [Mon, 27 Jan 2025 10:30:20 +0000 (18:30 +0800)] 
gh-128563: Move labels in ceval.c to bytecodes.c (GH-129112)

9 months agogh-124703: Do not raise an exception when quitting pdb (#124704)
Tian Gao [Mon, 27 Jan 2025 03:29:16 +0000 (22:29 -0500)] 
gh-124703: Do not raise an exception when quitting pdb (#124704)

9 months agogh-129156: Fix variable quoting in `android-env.sh` script (#129321)
Zanie Blue [Mon, 27 Jan 2025 02:53:24 +0000 (20:53 -0600)] 
gh-129156: Fix variable quoting in `android-env.sh` script (#129321)

Adds quoting to `android-env.sh` to protect against spaces in paths.