]>
git.ipfire.org Git - thirdparty/Python/cpython.git/log
Victor Stinner [Tue, 4 Feb 2025 15:21:10 +0000 (16:21 +0100)]
gh-129354: Use PyErr_FormatUnraisable() function (#129656)
Replace PyErr_WriteUnraisable() with PyErr_FormatUnraisable().
Serhiy Storchaka [Tue, 4 Feb 2025 14:25:49 +0000 (16:25 +0200)]
gh-128772: Fix pydoc for methods with __module__ is None (GH-129177)
Serhiy Storchaka [Tue, 4 Feb 2025 14:24:22 +0000 (16:24 +0200)]
gh-129350: Make tests for glob with trailing slash more strict (GH-129376)
Test that the trailing pathname separator is preserved.
Multiple trailing pathname separators are only preserved if the pattern
does not contain metacharacters, otherwise only one trailing pathname
separator is preserved. This is rather an implementation detail.
Serhiy Storchaka [Tue, 4 Feb 2025 14:16:41 +0000 (16:16 +0200)]
Use roles :data: and :const: for referencing module variables (GH-129507)
Mark Shannon [Tue, 4 Feb 2025 14:00:51 +0000 (14:00 +0000)]
GH-128682: Mark two more macros as escaping. (GH-129645)
Expand out SETLOCAL so that code generator can see the decref. Mark Py_CLEAR as escaping
Mark Shannon [Tue, 4 Feb 2025 12:18:31 +0000 (12:18 +0000)]
GH-128682: Spill the stack pointer in labels, as well as instructions (GH-129618)
Yan Yanchii [Tue, 4 Feb 2025 10:38:06 +0000 (11:38 +0100)]
gh-126835: Fix reference leak in `Python/flowgrapc.::optimize_if_const_subscr` (#129634)
Yan Yanchii [Tue, 4 Feb 2025 08:10:55 +0000 (09:10 +0100)]
gh-126835: Move constant subscript folding to CFG (#129568)
Move folding of constant subscription from AST optimizer to CFG.
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
donBarbos [Mon, 3 Feb 2025 16:42:12 +0000 (20:42 +0400)]
gh-111637: Clarify MIME type recognition behavior in mimetypes documentation (GH-129546)
Mark Shannon [Mon, 3 Feb 2025 15:09:21 +0000 (15:09 +0000)]
GH-128563: Generate `opcode = ...` in instructions that need `opcode` (GH-129608)
* Remove support for GO_TO_INSTRUCTION
Mark Shannon [Mon, 3 Feb 2025 12:41:32 +0000 (12:41 +0000)]
GH-128682: Make `PyStackRef_CLOSE` escaping. (GH-129404)
Victor Stinner [Mon, 3 Feb 2025 12:10:18 +0000 (13:10 +0100)]
gh-129354: Use PyErr_FormatUnraisable() function (#129524)
Replace PyErr_WriteUnraisable() with PyErr_FormatUnraisable().
Update test_sqlite3 tests.
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Victor Stinner [Mon, 3 Feb 2025 11:55:22 +0000 (12:55 +0100)]
gh-101944: Clarify PyModule_AddObjectRef() documentation (#129433)
Peter Bierma [Mon, 3 Feb 2025 11:46:13 +0000 (06:46 -0500)]
gh-129407: Clarify that a `SystemError` isn't always CPython's fault (#129410)
Victor Stinner [Mon, 3 Feb 2025 11:36:41 +0000 (12:36 +0100)]
gh-129342: Explain how to replace Py_GetProgramName() in C (#129361)
Illia Volochii [Mon, 3 Feb 2025 10:23:27 +0000 (12:23 +0200)]
gh-81340: Use copy_file_range in shutil.copyfile copy functions (GH-93152)
This allows the underlying file system an opportunity to optimise or avoid the actual copy.
Diego Russo [Sun, 2 Feb 2025 23:19:55 +0000 (23:19 +0000)]
GH-129231: Group executable JIT code in memory (GH-129232)
Diego Russo [Sun, 2 Feb 2025 23:17:53 +0000 (23:17 +0000)]
GH-128842: Collect JIT memory stats (GH-128941)
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>
Erlend E. Aasland [Sun, 2 Feb 2025 23:03:54 +0000 (00:03 +0100)]
gh-105875: amend sqlite3 docstring wrt. SQLite requirement (#129599)
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.
Adam Turner [Sun, 2 Feb 2025 16:17:02 +0000 (16:17 +0000)]
GH-121970: Extract ``misc_news`` into a new extension (#129577)
Adam Turner [Sun, 2 Feb 2025 16:12:01 +0000 (16:12 +0000)]
gh-126609: Allow translating the ``availability`` directive (#129549)
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>
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 .
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.
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.
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.
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)
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, ...).
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>
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>
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)
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>
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.
Valery Fedorenko [Fri, 31 Jan 2025 14:36:30 +0000 (22:36 +0800)]
gh-126108: Fix potential null pointer dereference in `PySys_AddWarnOptionUnicode` (#126118)
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)
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().
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()
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
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.
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().
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
qm2k [Fri, 31 Jan 2025 12:16:24 +0000 (12:16 +0000)]
gh-71494: string.Formatter: support keys/attributes in unnumbered fields (GH-21767)
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().
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
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)
Brandt Bucher [Fri, 31 Jan 2025 10:50:54 +0000 (02:50 -0800)]
GH-129386: Add `test.support.reset_code` (GH-129486)
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.
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)
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".
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 .
Kumar Aditya [Fri, 31 Jan 2025 08:11:11 +0000 (13:41 +0530)]
gh-128452: fix warning in socketmodule.c (#129478)
Cody Maloney [Thu, 30 Jan 2025 22:24:52 +0000 (14:24 -0800)]
gh-129205: Update multiprocessing.forkserver to use os.readinto() (#129425)
donBarbos [Thu, 30 Jan 2025 19:34:09 +0000 (19:34 +0000)]
gh-127349: Add check for correct resizing in REPL (#127387)
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.
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().
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)
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.
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.
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.
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.
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().
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>
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`
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>
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>
Filipe Laíns 🇵🇸 [Thu, 30 Jan 2025 03:32:24 +0000 (03:32 +0000)]
tests: add test.support.venv.VirtualEnvironmentMixin (#129461)
Victor Stinner [Thu, 30 Jan 2025 00:02:31 +0000 (01:02 +0100)]
gh-128779: Fix site venv() for system site-packages (#129184)
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>
Filipe Laíns 🇵🇸 [Wed, 29 Jan 2025 22:47:20 +0000 (22:47 +0000)]
GH-127178: improve compatibility in `_sysconfig_vars_(...).json` (#128558)
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>
Tomas R. [Wed, 29 Jan 2025 20:59:45 +0000 (21:59 +0100)]
gh-125522: Fix bare except in `test_uuid` (#129018)
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>
Brandt Bucher [Wed, 29 Jan 2025 18:49:58 +0000 (10:49 -0800)]
GH-129386: Use symbolic constants for specialization tests (GH-129415)
Taneli Hukkinen [Wed, 29 Jan 2025 17:24:37 +0000 (19:24 +0200)]
gh-118761: Always lazy import `warnings` in `threading` (#129428)
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
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.
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)
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.
Burkov Egor [Wed, 29 Jan 2025 13:49:23 +0000 (16:49 +0300)]
gh-129345: null check for indent syslogmodule (#129348)
Hugo van Kemenade [Wed, 29 Jan 2025 13:18:19 +0000 (15:18 +0200)]
CI: Change job name to 'build arm64' on Windows (#129434)
gh-129409: Fix Integer overflow - SEGV while writing data more than 2GB in CSV file (#129413)
Irit Katriel [Wed, 29 Jan 2025 09:28:21 +0000 (09:28 +0000)]
gh-100239: specialize bitwise logical binary ops on ints (#128927)
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) [Wed, 29 Jan 2025 09:16:51 +0000 (10:16 +0100)]
Merge TSAN test matrices in CI (#123278)
Pieter Eendebak [Wed, 29 Jan 2025 09:15:24 +0000 (10:15 +0100)]
gh-126703: Add freelists for list and tuple iterators (GH-128592)
Brandt Bucher [Wed, 29 Jan 2025 00:26:46 +0000 (16:26 -0800)]
GH-128563: Don't leave frame->lltrace uninitialized (GH-129417)
Brandt Bucher [Wed, 29 Jan 2025 00:10:51 +0000 (16:10 -0800)]
GH-126599: Remove the PyOptimizer API (GH-129194)
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.
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.
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.
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.
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>
Samuel GIFFARD [Tue, 28 Jan 2025 18:25:51 +0000 (19:25 +0100)]
gh-129408: http: Fix typo 'RFF' to RFC' in documentation (#129411)
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.
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.
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.
RUANG (James Roy) [Tue, 28 Jan 2025 00:12:45 +0000 (08:12 +0800)]
gh-85046: Document errno constants (#126420)
Erlend E. Aasland [Mon, 27 Jan 2025 17:16:19 +0000 (18:16 +0100)]
gh-129346: Handle allocation errors for SQLite aggregate context (#129347)
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.