]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
9 months agogh-128734: Fix ResourceWarning in urllib tests (GH-128735) 128348/head
Serhiy Storchaka [Sun, 12 Jan 2025 10:53:17 +0000 (12:53 +0200)] 
gh-128734: Fix ResourceWarning in urllib tests (GH-128735)

9 months agogh-128729: Fix RuntimeWarning in test_unittest (GH-128730)
Serhiy Storchaka [Sun, 12 Jan 2025 10:22:43 +0000 (12:22 +0200)] 
gh-128729: Fix RuntimeWarning in test_unittest (GH-128730)

9 months agogh-128377: Skip `test_cmd_line.test_non_interactive_output_buffering` when `PYTHONUNB...
Yan Yanchii [Sun, 12 Jan 2025 08:27:28 +0000 (09:27 +0100)] 
gh-128377: Skip `test_cmd_line.test_non_interactive_output_buffering` when `PYTHONUNBUFFERED=1` (#128378)

The `test_cmd_line.test_non_interactive_output_buffering` test assumes a buffered `stdio`
without checking the `PYTHONUNBUFFERED` value. Instead of changing the environment
variable for the duration of the test, it is better to simply skip it.

9 months agoGH-128520: Divide pathlib ABCs into three classes (#128523)
Barney Gale [Sat, 11 Jan 2025 19:27:47 +0000 (19:27 +0000)] 
GH-128520: Divide pathlib ABCs into three classes (#128523)

In the private pathlib ABCs, rename `PurePathBase` to `JoinablePath`, and
split `PathBase` into `ReadablePath` and `WritablePath`. This improves the
API fit for read-only virtual filesystems.

The split of `PathBase` entails a similar split of `CopyWorker` (implements
copying) and the test cases in `test_pathlib_abc`.

In a later patch, we'll make `WritablePath` inherit directly from
`JoinablePath` rather than `ReadablePath`. For a couple of reasons,
this isn't quite possible yet.

9 months agogh-128438: Add `EnvironmentVarGuard` for `test_pdb.py` (#128522)
Yan Yanchii [Sat, 11 Jan 2025 16:19:29 +0000 (17:19 +0100)] 
gh-128438: Add `EnvironmentVarGuard` for `test_pdb.py` (#128522)

9 months agoMake the Python CLI error message style more consistent (GH-128129)
9cel [Sat, 11 Jan 2025 09:17:35 +0000 (05:17 -0400)] 
Make the Python CLI error message style more consistent (GH-128129)

9 months agogh-128696: Add arm64 to the get_platform return val description (#128701)
RUANG (James Roy) [Sat, 11 Jan 2025 01:03:12 +0000 (09:03 +0800)] 
gh-128696: Add arm64 to the get_platform return val description (#128701)

9 months agogh-128409: Document that pdb.post_mortem() accepts exceptions (#128410)
Adam Johnson [Fri, 10 Jan 2025 15:54:45 +0000 (15:54 +0000)] 
gh-128409: Document that pdb.post_mortem() accepts exceptions (#128410)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
9 months agogh-127257: Add hex code to ssl "unknown error" message (GH-127360)
Petr Viktorin [Fri, 10 Jan 2025 12:59:51 +0000 (13:59 +0100)] 
gh-127257: Add hex code to ssl "unknown error" message (GH-127360)

* ssl: Add hex error code to "unknown error" messages

To make it easier to vary the individual parts of the message,
replace the if-ladder with constant format strings by building
the string piece-wise with PyUnicodeWriter.

Use "unknown error (0x%x)" rather than just "unknown error" if we
can't get a better error message. (Hex makes sense as the error
includes two packed parts.)

9 months agogh-128388: pyrepl on Windows: add meta and ctrl+arrow keybindings (GH-128389)
Paulie Peña [Fri, 10 Jan 2025 12:52:19 +0000 (07:52 -0500)] 
gh-128388: pyrepl on Windows: add meta and ctrl+arrow keybindings (GH-128389)

Fix `Lib/_pyrepl/windows_console.py` to support more keybindings, like the
`Ctrl`+`←` and `Ctrl`+`→` word-skipping keybindings and those with meta (i.e. Alt),
e.g. to `kill-word` or `backward-kill-word`.

Specifics: if Ctrl is pressed, emit "ctrl left" and "ctrl right" instead of just "left" or
"right," and if Meta/Alt is pressed, emit the special key code for meta before
emitting the other key that was pressed.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
9 months agogh-111178: fix UBSan failures for `gdbmobject` (GH-128178)
Bénédikt Tran [Fri, 10 Jan 2025 10:52:36 +0000 (11:52 +0100)] 
gh-111178: fix UBSan failures for `gdbmobject` (GH-128178)

* fix UBSan failures for `gdbmobject`
* suppress unused return values

9 months agogh-111178: fix UBSan failures in `Python/bltinmodule.c` (GH-128235)
Bénédikt Tran [Fri, 10 Jan 2025 10:51:24 +0000 (11:51 +0100)] 
gh-111178: fix UBSan failures in `Python/bltinmodule.c` (GH-128235)

* fix UBSan failures for `filterobject`
* fix UBSan failures for `mapobject`
* fix UBSan failures for `zipobject`

9 months agogh-111178: fix UBSan failures in `Objects/bytearrayobject.c` (GH-128236)
Bénédikt Tran [Fri, 10 Jan 2025 10:50:02 +0000 (11:50 +0100)] 
gh-111178: fix UBSan failures in `Objects/bytearrayobject.c` (GH-128236)

* fix UBSan failures for `bytesiterobject`
* fix UBSan failures for `PyByteArrayObject`

9 months agogh-111178: fix UBSan failures in `Objects/bytesobject.c` (GH-128237)
Bénédikt Tran [Fri, 10 Jan 2025 10:48:06 +0000 (11:48 +0100)] 
gh-111178: fix UBSan failures in `Objects/bytesobject.c` (GH-128237)

* remove redundant casts for `bytesobject`
* fix UBSan failures for `striterobject`

9 months agogh-111178: fix UBSan failures in `Modules/_bz2module.c` (GH-128238)
Bénédikt Tran [Fri, 10 Jan 2025 10:47:19 +0000 (11:47 +0100)] 
gh-111178: fix UBSan failures in `Modules/_bz2module.c` (GH-128238)

9 months agogh-111178: fix UBSan failures in `Objects/complexobject.c` (GH-128241)
Bénédikt Tran [Fri, 10 Jan 2025 10:46:36 +0000 (11:46 +0100)] 
gh-111178: fix UBSan failures in `Objects/complexobject.c` (GH-128241)

fix UBSan failures for `PyComplexObject`

9 months agogh-128694: Fix `(env changed)` error in `test_inspect` (#128702)
sobolevn [Fri, 10 Jan 2025 10:25:02 +0000 (13:25 +0300)] 
gh-128694: Fix `(env changed)` error in `test_inspect` (#128702)

9 months agogh-126862: Use `Py_ssize_t` instead of `int` when processing the number of super...
Bénédikt Tran [Fri, 10 Jan 2025 03:32:53 +0000 (04:32 +0100)] 
gh-126862: Use `Py_ssize_t` instead of `int` when processing the number of super-classes  (#127523)

9 months agogh-128691: Use deferred reference counting on `_thread._local` (#128693)
Sam Gross [Fri, 10 Jan 2025 00:59:10 +0000 (19:59 -0500)] 
gh-128691: Use deferred reference counting on `_thread._local` (#128693)

This change, along with the LOAD_ATTR specializations, makes the
"thread_local_read" micro benchmark in Tools/ftscalingbench/ftscalingbench.py
scale well to multiple threads.

9 months agogh-127196: Fix crash in `_interpreters`, when `shared` had invalid encodings (#127220)
sobolevn [Thu, 9 Jan 2025 19:45:35 +0000 (22:45 +0300)] 
gh-127196: Fix crash in `_interpreters`, when `shared` had invalid encodings (#127220)

9 months agogh-128650: Fix incorrect statement in partial documentation (gh-128651)
dgpb [Thu, 9 Jan 2025 19:32:00 +0000 (21:32 +0200)] 
gh-128650: Fix incorrect statement in partial documentation (gh-128651)

9 months agogh-128002: fix `asyncio.all_tasks` against concurrent deallocations of tasks (#128541)
Kumar Aditya [Thu, 9 Jan 2025 15:56:00 +0000 (21:26 +0530)] 
gh-128002: fix `asyncio.all_tasks` against concurrent deallocations of tasks (#128541)

9 months agogh-128661: Fix `typing.evaluate_forward_ref` not showing deprecation (#128663)
sobolevn [Thu, 9 Jan 2025 15:15:13 +0000 (18:15 +0300)] 
gh-128661: Fix `typing.evaluate_forward_ref` not showing deprecation (#128663)

gh-128661: Fix `typing.evaluate_forward_ref` not showing deprecataion

9 months agogh-128673: Increase coverage of `typing.get_type_hints` (#128674)
sobolevn [Thu, 9 Jan 2025 14:25:03 +0000 (17:25 +0300)] 
gh-128673: Increase coverage of `typing.get_type_hints` (#128674)

9 months agogh-118915: Document `PyUnstable_InterpreterState_GetMainModule` (GH-128483)
Peter Bierma [Thu, 9 Jan 2025 13:54:44 +0000 (08:54 -0500)] 
gh-118915: Document `PyUnstable_InterpreterState_GetMainModule` (GH-128483)

9 months agogh-124433: fix docs for `asyncio.Queue.task_done` (#128669)
Kumar Aditya [Thu, 9 Jan 2025 12:20:12 +0000 (17:50 +0530)] 
gh-124433: fix docs for `asyncio.Queue.task_done` (#128669)

9 months agogh-126137: improve docs for `loop.add_reader` and `loop.add_writer` (#128666)
Kumar Aditya [Thu, 9 Jan 2025 10:10:45 +0000 (15:40 +0530)] 
gh-126137: improve docs for `loop.add_reader` and `loop.add_writer` (#128666)

9 months agogh-128629: Add Py_PACK_VERSION and Py_PACK_FULL_VERSION (GH-128630)
Petr Viktorin [Thu, 9 Jan 2025 10:10:28 +0000 (11:10 +0100)] 
gh-128629: Add Py_PACK_VERSION and Py_PACK_FULL_VERSION (GH-128630)

9 months agogh-79149: document reentrant safety of `loop.call_soon_threadsafe` (#128662)
Kumar Aditya [Thu, 9 Jan 2025 09:19:05 +0000 (14:49 +0530)] 
gh-79149: document reentrant safety of `loop.call_soon_threadsafe` (#128662)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
9 months agogh-97850: Remove the mention of removal from `ResourceReader` docs (#128602)
Tomas R. [Wed, 8 Jan 2025 23:38:02 +0000 (00:38 +0100)] 
gh-97850: Remove the mention of removal from `ResourceReader` docs (#128602)

Remove the mention of removal from ResourceReader docs

10 months agoacks: add myself (#128652)
Filipe Laíns 🇵🇸 [Wed, 8 Jan 2025 21:10:43 +0000 (21:10 +0000)] 
acks: add myself (#128652)

10 months agoGH-66409: check if exec_prefix is the same as prefix before searching executable_dir...
Filipe Laíns 🇵🇸 [Wed, 8 Jan 2025 20:23:16 +0000 (20:23 +0000)] 
GH-66409: check if exec_prefix is the same as prefix before searching executable_dir (#127974)

10 months agoRemove unnecessary LIST_TO_TUPLE conversions (GH-126558)
Brandt Bucher [Wed, 8 Jan 2025 17:00:11 +0000 (09:00 -0800)] 
Remove unnecessary LIST_TO_TUPLE conversions (GH-126558)

10 months agogh-111178: fix UBSan failures in `Objects/capsule.c` (GH-128239)
Bénédikt Tran [Wed, 8 Jan 2025 13:55:04 +0000 (14:55 +0100)] 
gh-111178: fix UBSan failures in `Objects/capsule.c` (GH-128239)

fix UBSan failures for `PyCapsule`

10 months agogh-111178: fix UBSan failures in `Python/context.c` (GH-128242)
Bénédikt Tran [Wed, 8 Jan 2025 13:52:27 +0000 (14:52 +0100)] 
gh-111178: fix UBSan failures in `Python/context.c` (GH-128242)

* fix UBSan failures for `PyContext`
* fix UBSan failures for `PyContextVar`
* fix UBSan failures for `PyContextToken`
* fix UBSan failures for `_PyContextTokenMissing`

10 months agogh-111178: fix UBSan failures in `Python/hamt.c` (GH-128247)
Bénédikt Tran [Wed, 8 Jan 2025 13:50:40 +0000 (14:50 +0100)] 
gh-111178: fix UBSan failures in `Python/hamt.c` (GH-128247)

* fix UBSan failures for `PyHamtObject`
* fix UBSan failures for `PyHamtNode_Array`
* fix UBSan failures for `PyHamtNode_Collision`
* fix UBSan failures for `PyHamtNode_Bitmap`

10 months agogh-128615: Cover pickling of `ParamSpecArgs` and `ParamSpecKwargs` (#128616)
sobolevn [Wed, 8 Jan 2025 12:04:54 +0000 (15:04 +0300)] 
gh-128615: Cover pickling of `ParamSpecArgs` and `ParamSpecKwargs` (#128616)

10 months agoGH-127970: find the runtime library when dladdr is available (#127972)
Filipe Laíns 🇵🇸 [Wed, 8 Jan 2025 12:03:21 +0000 (12:03 +0000)] 
GH-127970: find the runtime library when dladdr is available (#127972)

10 months agogh-128613: Increase `typing.Concatenate` coverage (#128614)
sobolevn [Wed, 8 Jan 2025 12:02:47 +0000 (15:02 +0300)] 
gh-128613: Increase `typing.Concatenate` coverage (#128614)

10 months agogh-128617: Fix `test_typing.test_readonly_inheritance` (#128618)
sobolevn [Wed, 8 Jan 2025 11:19:41 +0000 (14:19 +0300)] 
gh-128617: Fix `test_typing.test_readonly_inheritance` (#128618)

10 months agogh-41872: Fix quick extraction of module docstrings from a file in pydoc (GH-127520)
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) [Wed, 8 Jan 2025 10:32:07 +0000 (16:02 +0530)] 
gh-41872: Fix quick extraction of module docstrings from a file in pydoc (GH-127520)

It now supports docstrings with single quotes, escape sequences,
raw string literals, and other Python syntax.

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
10 months agogh-87506: Amend json.loads() post PR #127355 (#128609)
Erlend E. Aasland [Wed, 8 Jan 2025 08:36:44 +0000 (09:36 +0100)] 
gh-87506: Amend json.loads() post PR #127355 (#128609)

10 months agogh-87506: Document that json.load*() can raise UnicodeDecodeError (#127355)
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) [Wed, 8 Jan 2025 07:35:43 +0000 (13:05 +0530)] 
gh-87506: Document that json.load*() can raise UnicodeDecodeError (#127355)

Co-authored-by: Erlend Aasland <erlend@python.org>
10 months agoGH-127809: Fix the JIT's understanding of ** (GH-127844)
Brandt Bucher [Wed, 8 Jan 2025 01:25:48 +0000 (17:25 -0800)] 
GH-127809: Fix the JIT's understanding of ** (GH-127844)

10 months agogh-127614: Correctly check for ttyname_r() in configure (#128503)
Erlend E. Aasland [Tue, 7 Jan 2025 21:42:36 +0000 (22:42 +0100)] 
gh-127614: Correctly check for ttyname_r() in configure (#128503)

PR #14868 replaced the ttyname() call with ttyname_r(), but the old
check remained.

10 months agogh-127350: Add more tests for Py_fopen() (GH-128587)
Serhiy Storchaka [Tue, 7 Jan 2025 21:13:08 +0000 (23:13 +0200)] 
gh-127350: Add more tests for Py_fopen() (GH-128587)

10 months agoDocs: mark up json.load() using parameter list (#128488)
Erlend E. Aasland [Tue, 7 Jan 2025 21:07:17 +0000 (22:07 +0100)] 
Docs: mark up json.load() using parameter list (#128488)

10 months agogh-115999: Add free-threaded specialization for COMPARE_OP (#126410)
T. Wouters [Tue, 7 Jan 2025 14:41:01 +0000 (06:41 -0800)] 
gh-115999: Add free-threaded specialization for COMPARE_OP (#126410)

Add free-threaded specialization for COMPARE_OP, and tests for COMPARE_OP specialization in general.

Co-authored-by: Donghee Na <donghee.na92@gmail.com>
10 months agogh-111178: fix UBSan failures in `Modules/_sre/sre.c` (GH-128250)
Bénédikt Tran [Tue, 7 Jan 2025 11:47:18 +0000 (12:47 +0100)] 
gh-111178: fix UBSan failures in `Modules/_sre/sre.c` (GH-128250)

fix UBSan failures for `PatternObject`, `MatchObject`, `TemplateObject`, `ScannerObject`

10 months agogh-111178: fix UBSan failures in `Modules/_abc.c` (GH-128253)
Bénédikt Tran [Tue, 7 Jan 2025 11:45:29 +0000 (12:45 +0100)] 
gh-111178: fix UBSan failures in `Modules/_abc.c` (GH-128253)

* fix UBSan failures in `_abc.c`
* suppress unused return values

10 months agogh-128552: fix refcycles in eager task creation (#128553)
Thomas Grainger [Tue, 7 Jan 2025 11:44:57 +0000 (11:44 +0000)] 
gh-128552: fix refcycles in eager task creation (#128553)

10 months agogh-128302: Fix bugs in xml.dom.xmlbuilder (GH-128284)
Stephen Morton [Tue, 7 Jan 2025 10:40:41 +0000 (02:40 -0800)] 
gh-128302: Fix bugs in xml.dom.xmlbuilder (GH-128284)

* Allow DOMParser.parse() to correctly handle DOMInputSource instances
  that only have a systemId attribute set.
* Fix DOMEntityResolver.resolveEntity(), which was broken by the
  Python 3.0 transition.
* Add Lib/test/test_xml_dom_xmlbuilder.py with few tests.

10 months agoAdd `.. availability:: Windows` directive to COM-related function prototype (GH-127436)
Jun Komoda [Tue, 7 Jan 2025 08:36:27 +0000 (17:36 +0900)] 
Add `.. availability:: Windows` directive to COM-related function prototype (GH-127436)

Add a directive to prototype that "returns a foreign function that will call a COM method"

10 months agogh-108202: Document calendar.Calendar.firstweekday (#128566)
Erlend E. Aasland [Tue, 7 Jan 2025 07:59:24 +0000 (08:59 +0100)] 
gh-108202: Document calendar.Calendar.firstweekday (#128566)

10 months agogh-128146: Exclude os/log.h import on older macOS versions. (#128165)
Russell Keith-Magee [Tue, 7 Jan 2025 05:12:58 +0000 (13:12 +0800)] 
gh-128146: Exclude os/log.h import on older macOS versions. (#128165)

Reworks the handling of Apple system log handling to account for older macOS
versions that don't provide os-log.

10 months agogh-128472: Add `-skip-funcs` to BOLT options to fix computed goto errors (gh-128511)
Zanie Blue [Tue, 7 Jan 2025 03:02:55 +0000 (21:02 -0600)] 
gh-128472: Add `-skip-funcs` to BOLT options to fix computed goto errors (gh-128511)

* Add `-skip-funcs` to BOLT options to fix computed goto errors

Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>
* NEWS

---------

Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>
10 months agogh-108202: Document `calendar.Calendar` methods `getfirstweekday` and `setfirstweekda...
Stan Ulbrych [Mon, 6 Jan 2025 23:38:45 +0000 (23:38 +0000)] 
gh-108202: Document `calendar.Calendar` methods `getfirstweekday` and `setfirstweekday` (#127579)

10 months agogh-128559: Remove typing import from asyncio.timeouts (#128560)
Michael H [Mon, 6 Jan 2025 23:03:27 +0000 (18:03 -0500)] 
gh-128559: Remove typing import from asyncio.timeouts (#128560)

10 months agogh-127146: Strip dash from Emscripten compiler version (#128557)
Hood Chatham [Mon, 6 Jan 2025 22:26:35 +0000 (23:26 +0100)] 
gh-127146: Strip dash from Emscripten compiler version (#128557)

`emcc -dumpversion` will sometimes say e.g., `4.0.0-git` but in this case
uname does not include `-git` in the version string. Use cut to delete
everything after the dash.

10 months agogh-127146: Skip Emscripten tests with pending fixes (#128549)
Hood Chatham [Mon, 6 Jan 2025 22:25:29 +0000 (23:25 +0100)] 
gh-127146: Skip Emscripten tests with pending fixes (#128549)

Marks some additional tests as skipped on Emscripten. Many of these skips can be
reverted when the next Emscripten release is available.

10 months agoGH-128533: Add `NOT_TAKEN` instruction after bytecode optimization. (GH-128554)
Mark Shannon [Mon, 6 Jan 2025 22:01:07 +0000 (22:01 +0000)] 
GH-128533: Add `NOT_TAKEN` instruction after bytecode optimization. (GH-128554)

10 months agogh-127146: Fix test_sysconfigdata_json for Emscripten (#128556)
Hood Chatham [Mon, 6 Jan 2025 19:45:14 +0000 (20:45 +0100)] 
gh-127146: Fix test_sysconfigdata_json for Emscripten (#128556)

10 months agoGH-128375: Better instrument for `FOR_ITER` (GH-128445)
Mark Shannon [Mon, 6 Jan 2025 17:54:47 +0000 (17:54 +0000)] 
GH-128375: Better instrument for `FOR_ITER` (GH-128445)

10 months agoGH-128073: Include `EXIT_IF` when checking for escaping calls (GH-128537)
Mark Shannon [Mon, 6 Jan 2025 14:16:22 +0000 (14:16 +0000)] 
GH-128073: Include `EXIT_IF` when checking for escaping calls (GH-128537)

10 months agogh-127350: Add Py_fopen() and Py_fclose() functions (#127821)
Victor Stinner [Mon, 6 Jan 2025 12:43:09 +0000 (13:43 +0100)] 
gh-127350: Add Py_fopen() and Py_fclose() functions (#127821)

10 months agogh-128340: add thread safe handle for `loop.call_soon_threadsafe` (#128369)
Kumar Aditya [Mon, 6 Jan 2025 12:35:11 +0000 (18:05 +0530)] 
gh-128340: add thread safe handle for `loop.call_soon_threadsafe` (#128369)

Adds `_ThreadSafeHandle` to be used for callbacks scheduled with `loop.call_soon_threadsafe`.

10 months agogh-90241: Clarify documentation for PyUnicode_FSConverter and PyUnicode_FSDecoder...
Serhiy Storchaka [Mon, 6 Jan 2025 12:28:50 +0000 (14:28 +0200)] 
gh-90241: Clarify documentation for PyUnicode_FSConverter and PyUnicode_FSDecoder (GH-128451)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
10 months agogh-111178: fix UBSan failures in `Objects/descrobject.c` (GH-128245)
Bénédikt Tran [Mon, 6 Jan 2025 11:50:01 +0000 (12:50 +0100)] 
gh-111178: fix UBSan failures in `Objects/descrobject.c` (GH-128245)

fix UBSan failures for `propertyobject`

10 months agogh-77214: Update outdated documentation for numeric PyArg_Parse formats (GH-128454)
Serhiy Storchaka [Mon, 6 Jan 2025 10:50:28 +0000 (12:50 +0200)] 
gh-77214: Update outdated documentation for numeric PyArg_Parse formats (GH-128454)

10 months agogh-128089: Add PYC magic number for VALUE_WITH_FAKE_GLOBALS (#128097)
Jelle Zijlstra [Mon, 6 Jan 2025 10:30:42 +0000 (02:30 -0800)] 
gh-128089: Add PYC magic number for VALUE_WITH_FAKE_GLOBALS (#128097)

Assign 3610 PYC magic number to VALUE_WITH_FAKE_GLOBALS
format of annotationlib.

10 months agogh-102471: convert decimal module to use PyLong_Export API (PEP 757) (#128267)
Sergey B Kirpichev [Mon, 6 Jan 2025 10:29:18 +0000 (13:29 +0300)] 
gh-102471: convert decimal module to use PyLong_Export API (PEP 757) (#128267)

10 months agogh-128519: Align the docstring of untokenize() to match the docs (#128521)
Tomas R. [Mon, 6 Jan 2025 08:42:26 +0000 (09:42 +0100)] 
gh-128519: Align the docstring of untokenize() to match the docs (#128521)

10 months agogh-98188: Fix EmailMessage.get_payload to decode data when CTE value has extra text...
RanKKI [Mon, 6 Jan 2025 01:32:16 +0000 (12:32 +1100)] 
gh-98188: Fix EmailMessage.get_payload to decode data when CTE value has extra text (#127547)

Up to this point message handling has been very strict with regards to content encoding values: mixed case was accepted, but trailing blanks or other text would cause decoding failure, even if the first token was a valid encoding.  By Postel's Rule we should go ahead and decode as long as we can recognize that first token.  We have not thought of any security or backward compatibility concerns with this fix.

This fix does introduce a new technique/pattern to the Message code: we look to see if the header has a 'cte' attribute, and if so we use that.  This effectively promotes the header API exposed by HeaderRegistry to an API that any header parser "should" support.  This seems like a reasonable thing to do.  It is not, however, a requirement, as the string value of the header is still used if there is no cte attribute.

The full fix (ignore any trailing blanks or blank-separated trailing text) applies only to the non-compat32 API.  compat32 is only fixed to the extent that it now ignores trailing spaces.  Note that the HeaderRegistry parsing still records a HeaderDefect if there is extra text.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
10 months agoDocs: fix `MessageDefect` references in email.policy docs (#128468)
Yuki Kobayashi [Sun, 5 Jan 2025 21:58:31 +0000 (06:58 +0900)] 
Docs: fix `MessageDefect` references in email.policy docs (#128468)

10 months agogh-128504: Upgrade doctest to ubuntu-24.04 (#128506)
Damien [Sun, 5 Jan 2025 12:07:18 +0000 (20:07 +0800)] 
gh-128504: Upgrade doctest to ubuntu-24.04 (#128506)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
10 months agogh-128137: Update PyASCIIObject to handle interned field with the atomic operation...
Donghee Na [Sun, 5 Jan 2025 09:17:06 +0000 (18:17 +0900)] 
gh-128137: Update PyASCIIObject to handle interned field with the atomic operation (gh-128196)

10 months agogh-128437: Add `BOLT_COMMON_FLAGS` with `-update-debug-sections` (gh-128455)
Zanie Blue [Sun, 5 Jan 2025 04:16:30 +0000 (22:16 -0600)] 
gh-128437: Add `BOLT_COMMON_FLAGS` with `-update-debug-sections` (gh-128455)

Add `BOLT_COMMON_FLAGS` with `-update-debug-sections`

Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>
10 months agogh-115765: Document and enforce Autoconf 2.72 requirement (#128502)
Erlend E. Aasland [Sat, 4 Jan 2025 23:38:46 +0000 (00:38 +0100)] 
gh-115765: Document and enforce Autoconf 2.72 requirement (#128502)

10 months agogh-127553: Remove outdated TODO comment in _pydatetime (#127564)
Beomsoo Kim [Sat, 4 Jan 2025 22:38:49 +0000 (07:38 +0900)] 
gh-127553: Remove outdated TODO comment in _pydatetime (#127564)

10 months agogh-127954: Document PyObject_DelItemString (#127986)
RUANG (James Roy) [Sat, 4 Jan 2025 20:48:20 +0000 (04:48 +0800)] 
gh-127954: Document PyObject_DelItemString (#127986)

10 months agoDocs: amend json.dump() post gh-128482 (#128489)
Erlend E. Aasland [Sat, 4 Jan 2025 18:57:59 +0000 (19:57 +0100)] 
Docs: amend json.dump() post gh-128482 (#128489)

10 months agogh-126719: Clarify math.fmod docs (#127741)
Stan Ulbrych [Sat, 4 Jan 2025 17:38:57 +0000 (17:38 +0000)] 
gh-126719: Clarify math.fmod docs (#127741)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
10 months agopathlib tests: create `walk()` test hierarchy without using class under test (#128338)
Barney Gale [Sat, 4 Jan 2025 15:45:24 +0000 (15:45 +0000)] 
pathlib tests: create `walk()` test hierarchy without using class under test (#128338)

In the tests for `pathlib.Path.walk()`, avoid using the path class under
test (`self.cls`) in test setup. Instead we use `os` functions in
`test_pathlib`, and direct manipulation of `DummyPath` internal data in
`test_pathlib_abc`.

10 months agoDocs: mark up json.dump() using parameter list (#128482)
Erlend E. Aasland [Sat, 4 Jan 2025 15:44:34 +0000 (16:44 +0100)] 
Docs: mark up json.dump() using parameter list (#128482)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
10 months agoGH-127381: pathlib ABCs: remove `PathBase.move()` and `move_into()` (#128337)
Barney Gale [Sat, 4 Jan 2025 12:53:51 +0000 (12:53 +0000)] 
GH-127381: pathlib ABCs: remove `PathBase.move()` and `move_into()` (#128337)

These methods combine `_delete()` and `copy()`, but `_delete()` isn't part
of the public interface, and it's unlikely to be added until the pathlib
ABCs are made official, or perhaps even later.

10 months agogh-128152: Argument Clinic: ignore pre-processor directives inside C comments (#128464)
Erlend E. Aasland [Sat, 4 Jan 2025 10:46:04 +0000 (11:46 +0100)] 
gh-128152: Argument Clinic: ignore pre-processor directives inside C comments (#128464)

10 months agoAdd `check-readthedocs` pre-commit hook (#128453)
sobolevn [Sat, 4 Jan 2025 10:31:01 +0000 (13:31 +0300)] 
Add `check-readthedocs` pre-commit hook (#128453)

10 months agogh-128002: fix many thread safety issues in asyncio (#128147)
Kumar Aditya [Sat, 4 Jan 2025 08:48:22 +0000 (14:18 +0530)] 
gh-128002: fix many thread safety issues in asyncio (#128147)

* Makes `_asyncio.Task` and `_asyncio.Future` thread-safe by adding critical sections
* Add assertions to check for thread safety checking locking of object by critical sections in internal functions
* Make `_asyncio.all_tasks` thread safe when eager tasks are used
* Add a thread safety test

10 months agogh-125985: Fix `cmodule_function()` scaling benchmark (#128460)
Sam Gross [Fri, 3 Jan 2025 21:48:47 +0000 (16:48 -0500)] 
gh-125985: Fix `cmodule_function()` scaling benchmark (#128460)

Add a separate benchmark that measures the effect of
`_PyObject_LookupSpecial()` on scaling.

In the process of cleaning up the scaling benchmarks for inclusion, I
unintentionally changed the "cmodule_function" benchmark to pass an
`int` to `math.floor()` instead of a `float`, which causes it to use the
`_PyObject_LookupSpecial()` code path. `_PyObject_LookupSpecial()` has
its own scaling issues that we want to measure separately from calling a
function on a C module.

10 months agogh-128354: Consistently use LIBS over LDFLAGS in library build checks (#128359)
Zanie Blue [Fri, 3 Jan 2025 20:51:06 +0000 (14:51 -0600)] 
gh-128354: Consistently use LIBS over LDFLAGS in library build checks (#128359)

10 months agogh-128456: Use '-reorder-functions=cdsort' for BOLT builds (#128457)
Zanie Blue [Fri, 3 Jan 2025 20:49:50 +0000 (14:49 -0600)] 
gh-128456: Use '-reorder-functions=cdsort' for BOLT builds (#128457)

'hfsort+' is deprecated in favor of 'cdsort'.

10 months agogh-128400: Only show the current thread in `faulthandler` if the GIL is disabled...
Peter Bierma [Fri, 3 Jan 2025 19:14:57 +0000 (14:14 -0500)] 
gh-128400: Only show the current thread in `faulthandler` if the GIL is disabled (GH-128425)

10 months agogh-127903: Fix a crash on debug builds when calling `Objects/unicodeobject::_copy_cha...
Alexander Shadchin [Fri, 3 Jan 2025 18:47:58 +0000 (21:47 +0300)] 
gh-127903: Fix a crash on debug builds when calling `Objects/unicodeobject::_copy_characters`` (#127876)

10 months agogh-89083: improve UUIDv8 uniqueness tests (GH-128149)
Bénédikt Tran [Fri, 3 Jan 2025 14:51:22 +0000 (15:51 +0100)] 
gh-89083: improve UUIDv8 uniqueness tests (GH-128149)

improve UUIDv8 uniqueness tests

10 months agogh-111178: fix UBSan failures in `Modules/zlibmodule.c` (GH-128252)
Bénédikt Tran [Fri, 3 Jan 2025 14:36:41 +0000 (15:36 +0100)] 
gh-111178: fix UBSan failures in `Modules/zlibmodule.c` (GH-128252)

10 months agogh-111178: fix UBSan failures in `Objects/tupleobject.c` (GH-128251)
Bénédikt Tran [Fri, 3 Jan 2025 14:35:05 +0000 (15:35 +0100)] 
gh-111178: fix UBSan failures in `Objects/tupleobject.c` (GH-128251)

fix UBSan failures for `_PyTupleIterObject`

10 months agogh-111178: fix UBSan failures in `Objects/enumobject.c` (GH-128246)
Bénédikt Tran [Fri, 3 Jan 2025 14:29:41 +0000 (15:29 +0100)] 
gh-111178: fix UBSan failures in `Objects/enumobject.c` (GH-128246)

* fix UBSan failures for `enumobject`
* fix UBSan failures for `reversedobject`

10 months agogh-111178: fix UBSan failures in `Modules/curses*.c` (GH-128244)
Bénédikt Tran [Fri, 3 Jan 2025 14:12:40 +0000 (15:12 +0100)] 
gh-111178: fix UBSan failures in `Modules/curses*.c` (GH-128244)

* fix UBSan failures in `_cursesmodule.c`
* fix UBSan failures in `_curses_panel.c`
* suppress an unused return value

10 months agogh-111178: fix UBSan failures in `Modules/_csv.c` (GH-128243)
Bénédikt Tran [Fri, 3 Jan 2025 14:04:33 +0000 (15:04 +0100)] 
gh-111178: fix UBSan failures in `Modules/_csv.c` (GH-128243)

Also: suppress unused return values

10 months agogh-112015: Implement `ctypes.memoryview_at()` (GH-112018)
Rian Hunter [Fri, 3 Jan 2025 13:07:07 +0000 (05:07 -0800)] 
gh-112015: Implement `ctypes.memoryview_at()` (GH-112018)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>