]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
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>
10 months agogh-128317: Highlight today in colour in calendar CLI output (#128318)
Hugo van Kemenade [Fri, 3 Jan 2025 12:56:24 +0000 (14:56 +0200)] 
gh-128317: Highlight today in colour in calendar CLI output (#128318)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
10 months agogh-127787: refactor helpers for `PyUnicodeErrorObject` internal interface (GH-127789)
Bénédikt Tran [Fri, 3 Jan 2025 12:37:02 +0000 (13:37 +0100)] 
gh-127787: refactor helpers for `PyUnicodeErrorObject` internal interface (GH-127789)

- Unify `get_unicode` and `get_string` in a single function.

- Allow to retrieve the underlying `object` attribute, its
  size, and the adjusted 'start' and 'end', all at once.
  Add a new `_PyUnicodeError_GetParams` internal function for this.
  (In `exceptions.c`, it's somewhat common to not need all the attributes,
  but the compiler has opportunity to inline the function and optimize
  unneeded work away. Outside that file, we'll usually need all or
  most of them at once.)

- Use a common implementation for the following functions:

  - `PyUnicode{Decode,Encode}Error_GetEncoding`
  - `PyUnicode{Decode,Encode,Translate}Error_GetObject`
  - `PyUnicode{Decode,Encode,Translate}Error_{Get,Set}Reason`
  - `PyUnicode{Decode,Encode,Translate}Error_{Get,Set}{Start,End}`

10 months agogh-115765: Upgrade to GNU Autoconf 2.72 (#128411)
Erlend E. Aasland [Fri, 3 Jan 2025 11:37:54 +0000 (12:37 +0100)] 
gh-115765: Upgrade to GNU Autoconf 2.72 (#128411)

10 months agogh-128404: Remove `asyncio` from `Lib/test/test_sys_settrace` (#128435)
Thomas Grainger [Fri, 3 Jan 2025 10:33:35 +0000 (10:33 +0000)] 
gh-128404: Remove `asyncio` from `Lib/test/test_sys_settrace` (#128435)

10 months agogh-127529: Correct asyncio's `accept_connection` behaviour for handling `ConnectionAb...
jb2170 [Fri, 3 Jan 2025 10:32:36 +0000 (10:32 +0000)] 
gh-127529: Correct asyncio's `accept_connection` behaviour for handling `ConnectionAbortedError` (#127532)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
10 months agogh-128104: Remove `Py_STRFTIME_C99_SUPPORT`; require C99-compliant strftime (#128106)
Zanie Blue [Fri, 3 Jan 2025 10:04:03 +0000 (04:04 -0600)] 
gh-128104: Remove `Py_STRFTIME_C99_SUPPORT`; require C99-compliant strftime (#128106)

10 months agogh-108202: Document calendar.TextCalendar formatting helpers (#127608)
Stan Ulbrych [Fri, 3 Jan 2025 09:57:15 +0000 (09:57 +0000)] 
gh-108202: Document calendar.TextCalendar formatting helpers (#127608)

Document the following TextCalendar methods:
- formatday()
- formatmonthname()
- formatweekday()
- formatweekheader()

10 months agogh-128133: use relaxed atomics for hash of bytes (#128412)
Abhijeet [Fri, 3 Jan 2025 08:20:56 +0000 (09:20 +0100)] 
gh-128133: use relaxed atomics for hash of bytes (#128412)

10 months agogh-128404: remove asyncio from test_type_params (#128436)
Thomas Grainger [Fri, 3 Jan 2025 07:50:24 +0000 (07:50 +0000)] 
gh-128404: remove asyncio from test_type_params (#128436)

10 months agogh-128426: Mention PySequence_Fast in free-threading C API HOWTO (#128428)
Nathan Goldbaum [Fri, 3 Jan 2025 07:40:24 +0000 (00:40 -0700)] 
gh-128426: Mention PySequence_Fast in free-threading C API HOWTO (#128428)

10 months agogh-128212: Fix race in `_PyUnicode_CheckConsistency` (GH-128367)
Sam Gross [Thu, 2 Jan 2025 19:02:54 +0000 (14:02 -0500)] 
gh-128212: Fix race in `_PyUnicode_CheckConsistency` (GH-128367)

There was a data race on the utf8 field between `PyUnicode_SET_UTF8` and
`_PyUnicode_CheckConsistency`. Use the `_PyUnicode_UTF8()` accessor,
which uses an atomic load internally, to avoid the data race.

10 months agogh-128400: Stop-the-world when manually calling `faulthandler` (GH-128422)
Peter Bierma [Thu, 2 Jan 2025 18:56:01 +0000 (13:56 -0500)] 
gh-128400: Stop-the-world when manually calling `faulthandler` (GH-128422)

10 months agoRemove asserts that confuse `enum _framestate` with `enum _frameowner` (GH-124148)
Anders Kaseorg [Thu, 2 Jan 2025 16:55:33 +0000 (08:55 -0800)] 
Remove asserts that confuse `enum _framestate` with `enum _frameowner` (GH-124148)

The `owner` field of `_PyInterpreterFrame` is supposed to be a member of
`enum _frameowner`, but `FRAME_CLEARED` is a member of `enum _framestate`.

At present, it happens that `FRAME_CLEARED` is not numerically equal to any
member of `enum _frameowner`, but that could change in the future. The code
that incorrectly assigned `owner = FRAME_CLEARED` was deleted in commit
a53cc3f49463e50cb3e2b839b3a82e6bf7f73fee (GH-116687). Remove the incorrect
checks for `owner != FRAME_CLEARED` as well.

10 months agogh-128014: Fix passing default='' to the tkinter method wm_iconbitmap() (GH-128015)
Zhikang Yan [Thu, 2 Jan 2025 15:51:57 +0000 (23:51 +0800)] 
gh-128014:  Fix passing default='' to the tkinter method wm_iconbitmap() (GH-128015)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
10 months agoRevert "Doc: Show object descriptions in the table of contents (#125757)" (#128406)
Hugo van Kemenade [Thu, 2 Jan 2025 14:35:00 +0000 (16:35 +0200)] 
Revert "Doc: Show object descriptions in the table of contents (#125757)" (#128406)

10 months agogh-128404: Remove ``asyncio`` from ``test_builtin`` (#128403)
Thomas Grainger [Thu, 2 Jan 2025 13:00:26 +0000 (13:00 +0000)] 
gh-128404: Remove ``asyncio`` from ``test_builtin`` (#128403)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
10 months agogh-126624: Expose error code ``XML_ERROR_NOT_STARTED`` of Expat >=2.6.4 (#126625)
Sebastian Pipping [Thu, 2 Jan 2025 12:54:38 +0000 (13:54 +0100)] 
gh-126624: Expose error code ``XML_ERROR_NOT_STARTED`` of Expat >=2.6.4 (#126625)

Expose error code ``XML_ERROR_NOT_STARTED`` in `xml.parsers.expat.errors` which was
introduced in Expat 2.6.4.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
10 months agogh-124130: Fix a bug in matching regular expression \B in empty string (GH-127007)
Serhiy Storchaka [Thu, 2 Jan 2025 12:11:21 +0000 (14:11 +0200)] 
gh-124130: Fix a bug in matching regular expression \B in empty string (GH-127007)

10 months agogh-123925: Fix building curses on platforms without libncursesw (GH-128405)
Serhiy Storchaka [Thu, 2 Jan 2025 11:38:21 +0000 (13:38 +0200)] 
gh-123925: Fix building curses on platforms without libncursesw (GH-128405)

10 months agogh-95371: Add support for other image formats(e.g. PNG) to the turtle… (#95378)
Shin-myoung-serp [Thu, 2 Jan 2025 09:45:07 +0000 (18:45 +0900)] 
gh-95371: Add support for other image formats(e.g. PNG) to the turtle… (#95378)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
10 months agogh-128349: Use `.. data::` instead of `.. class::` for pre-defined decimal `Context...
abkmystery [Thu, 2 Jan 2025 07:20:31 +0000 (01:20 -0600)] 
gh-128349: Use `.. data::` instead of `.. class::` for pre-defined decimal `Context` objects (#128379)

10 months agogh-126469: remove unnecessary error-checking branch in `lexer.c` (#126473)
qqwqqw689 [Wed, 1 Jan 2025 22:11:29 +0000 (06:11 +0800)] 
gh-126469: remove unnecessary error-checking branch in `lexer.c` (#126473)

10 months agoFix while statements with non-bool conditions in `_pyrepl` (#127509)
RUANG (James Roy) [Wed, 1 Jan 2025 20:39:28 +0000 (04:39 +0800)] 
Fix while statements with non-bool conditions in `_pyrepl` (#127509)

Fix non-bool value conditions

10 months agogh-128277: remove unnecessary critical section from `socket.close` (#128305)
Kumar Aditya [Wed, 1 Jan 2025 12:30:47 +0000 (18:00 +0530)] 
gh-128277: remove unnecessary critical section from `socket.close`  (#128305)

Remove unnecessary critical section from `socket.close` as it now uses relaxed atomics for `sock_fd`.

10 months agogh-121676: Raise a ``DeprecationWarning`` if the Python implementation of ``functools...
Kirill Podoprigora [Wed, 1 Jan 2025 11:36:47 +0000 (13:36 +0200)] 
gh-121676: Raise a ``DeprecationWarning`` if the Python implementation of ``functools.reduce`` is called with `function` or `sequence` as a keyword args (#121677)

Python implementation of `functools` allows calling `reduce`
with `function` or `sequence` as keyword args. This doesn't
match behavior of our C accelerator and our documentation
for `functools.reduce` states that `function`and `sequence`
are positional-only arguments.

Now calling a Python implementation of `functools.reduce`
with `function` or `sequence` as keyword args would raise
a `DeprecationWarning` and is planned to be prohibited in
Python 3.16.

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
10 months agoReword `about.rst` to not limit Sphinx (#128325)
Stan Ulbrych [Tue, 31 Dec 2024 21:22:33 +0000 (21:22 +0000)] 
Reword `about.rst` to not limit Sphinx (#128325)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
10 months agogh-128277: make globals variables thread safe in socket module (#128286)
Kumar Aditya [Tue, 31 Dec 2024 13:40:06 +0000 (19:10 +0530)] 
gh-128277: make globals variables thread safe in socket module (#128286)

10 months agogh-88834: Unify the instance check for typing.Union and types.UnionType (GH-128363)
Serhiy Storchaka [Tue, 31 Dec 2024 08:02:58 +0000 (10:02 +0200)] 
gh-88834: Unify the instance check for typing.Union and types.UnionType (GH-128363)

Union now uses the instance checks against its parameters instead of
the subclass checks.

10 months agogh-128277: use relaxed atomics for `sock_fd` (#128304)
Kumar Aditya [Tue, 31 Dec 2024 06:20:35 +0000 (11:50 +0530)] 
gh-128277: use relaxed atomics for `sock_fd` (#128304)

10 months agogh-128262: Allow specialization of calls to classes with __slots__ (GH-128263)
Ken Jin [Tue, 31 Dec 2024 04:24:17 +0000 (12:24 +0800)] 
gh-128262: Allow specialization of calls to classes with __slots__ (GH-128263)

10 months agogh-128342: Specify timeout unit in subprocess docstrings (GH-128343)
n-l-i [Mon, 30 Dec 2024 20:52:04 +0000 (21:52 +0100)] 
gh-128342: Specify timeout unit in subprocess docstrings (GH-128343)

Specify timeout unit (seconds) in subprocess docstrings

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
10 months agogh-128100: Use atomic dictionary load in `_PyObject_GenericGetAttrWithDict` (GH-128297)
Bogdan Romanyuk [Mon, 30 Dec 2024 20:38:49 +0000 (23:38 +0300)] 
gh-128100: Use atomic dictionary load in `_PyObject_GenericGetAttrWithDict` (GH-128297)

10 months agogh-119786: Mention `InternalDocs/interpreter.md` instead of non-existing `adaptive...
Yan Yanchii [Mon, 30 Dec 2024 18:38:09 +0000 (19:38 +0100)] 
gh-119786: Mention `InternalDocs/interpreter.md` instead of non-existing `adaptive.md` (#128329)

`Python/specialize.c`: Mention `InternalDocs/interpreter.md` instead of non-existing `adaptive.md`

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
10 months agogh-128317: Document `calendar.TextCalendar.formatweek` (#128353)
Hugo van Kemenade [Mon, 30 Dec 2024 17:25:39 +0000 (19:25 +0200)] 
gh-128317: Document `calendar.TextCalendar.formatweek` (#128353)

10 months agogh-128118: Speed up copy.copy with fast lookup for atomic and container types (#128119)
Pieter Eendebak [Mon, 30 Dec 2024 17:18:42 +0000 (18:18 +0100)] 
gh-128118: Speed up copy.copy with fast lookup for atomic and container types (#128119)

10 months agogh-119180: Set the name of the param to __annotate__ to "format" (#124730)
Jelle Zijlstra [Mon, 30 Dec 2024 16:19:38 +0000 (08:19 -0800)] 
gh-119180: Set the name of the param to __annotate__ to "format" (#124730)

10 months agoDocs: correctly markup sys.monitoring "What's New" entry (#128346)
Erlend E. Aasland [Mon, 30 Dec 2024 12:53:40 +0000 (13:53 +0100)] 
Docs: correctly markup sys.monitoring "What's New" entry (#128346)

The sys.monitoring entry was added with commit d2f1d917e.

10 months agogh-128321: Set LIBS instead of LDFLAGS when checking sqlite3 requirements (#128322)
Zanie Blue [Mon, 30 Dec 2024 08:55:14 +0000 (02:55 -0600)] 
gh-128321: Set LIBS instead of LDFLAGS when checking sqlite3 requirements (#128322)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
10 months agoGH-127381: pathlib ABCs: remove uncommon `PurePathBase` methods (#127853)
Barney Gale [Sun, 29 Dec 2024 22:07:12 +0000 (22:07 +0000)] 
GH-127381: pathlib ABCs: remove uncommon `PurePathBase` methods (#127853)

Remove `PurePathBase.relative_to()` and `is_relative_to()` because they
don't account for *other* being an entirely different kind of path, and
they can't use `__eq__()` because it's not on the `PurePathBase` interface.

Remove `PurePathBase.drive`, `root`, `is_absolute()` and `as_posix()`.
These are all too specific to local filesystems.

10 months agoGH-127381: pathlib ABCs: remove `PathBase.stat()` (#128334)
Barney Gale [Sun, 29 Dec 2024 21:42:07 +0000 (21:42 +0000)] 
GH-127381: pathlib ABCs: remove `PathBase.stat()` (#128334)

Remove the `PathBase.stat()` method. Its use of the `os.stat_result` API,
with its 10 mandatory fields and low-level types, makes it an awkward fit
for virtual filesystems.

We'll look to add a `PathBase.info` attribute later - see GH-125413.

10 months agogh-123424: add `ZipInfo._for_archive` to set suitable default properties (#123429)
Bénédikt Tran [Sun, 29 Dec 2024 18:30:53 +0000 (19:30 +0100)] 
gh-123424: add `ZipInfo._for_archive` to set suitable default properties (#123429)

---------

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
10 months agogh-128192: mark new tests with skips based on hashlib algorithm availability (gh...
Gregory P. Smith [Sun, 29 Dec 2024 06:32:32 +0000 (22:32 -0800)] 
gh-128192: mark new tests with skips based on hashlib algorithm availability (gh-128324)

Puts the _hashlib get_fips_mode logic check into test.support rather than spreading it out among other tests.

10 months agoexpand the `asyncio.run_coroutine_threadsafe` recipes (#127576)
Thomas Grainger [Sun, 29 Dec 2024 06:22:29 +0000 (06:22 +0000)] 
expand the `asyncio.run_coroutine_threadsafe` recipes (#127576)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
10 months agogh-128192: support HTTP sha-256 digest authentication as per RFC-7617 (GH-128193)
Calvin Bui [Sat, 28 Dec 2024 21:05:34 +0000 (08:05 +1100)] 
gh-128192: support HTTP sha-256 digest authentication as per RFC-7617 (GH-128193)

support sha-256 digest authentication

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
10 months agogh-128279: Enhance the NetBSD compatibility for thread naming (#128280)
Furkan Onder [Sat, 28 Dec 2024 18:49:45 +0000 (21:49 +0300)] 
gh-128279: Enhance the NetBSD compatibility for thread naming (#128280)

Enhance NetBSD compatibility for thread naming in _threadmodule.c.

10 months agogh-119786: Fix typos in `InternalDocs/parser.md` (#128314)
Yan Yanchii [Sat, 28 Dec 2024 15:05:00 +0000 (16:05 +0100)] 
gh-119786: Fix typos in `InternalDocs/parser.md` (#128314)

10 months agogh-128265: Support WASI/Emscripten on PDB tests, by removing asyncio from pdb tests...
Thomas Grainger [Sat, 28 Dec 2024 14:59:49 +0000 (14:59 +0000)] 
gh-128265: Support WASI/Emscripten on PDB tests, by removing asyncio from pdb tests (#128264)

A part of `Lib/test/test_pdb.py` was previously unable to run on WASI/Emscripten
platforms because it lacked support for `asyncio`.
In fact, these tests could be rewritten without the `asyncio` framework because
`test_pdb` tests the behavior of coroutines, which are not part of `asyncio`.

Now reliance on the availability of `asyncio` has been removed and
part of `test_pdb` that deals with coroutines working on WASI/Emscripten platforms.

10 months agogh-127586: multiprocessing.Pool does not properly restore blocked signals (try 2...
Stephen Hansen [Fri, 27 Dec 2024 22:09:01 +0000 (17:09 -0500)] 
gh-127586: multiprocessing.Pool does not properly restore blocked signals (try 2) (GH-128011)

Correct pthread_sigmask in resource_tracker to restore old signals

Using SIG_UNBLOCK to remove blocked "ignored signals" may accidentally
cause side effects if the calling parent already had said signals
blocked to begin with and did not intend to unblock them when
creating a pool. Use SIG_SETMASK instead with the previous mask of
blocked signals to restore the original blocked set.

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
10 months agogh-127949: make deprecation of policy system more prominent (#128290)
Kumar Aditya [Fri, 27 Dec 2024 15:13:41 +0000 (20:43 +0530)] 
gh-127949: make deprecation of policy system more prominent (#128290)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
10 months agogh-127089: Add missing description for codes in `http.HTTPStatus` (#127100)
donBarbos [Fri, 27 Dec 2024 14:12:25 +0000 (18:12 +0400)] 
gh-127089: Add missing description for codes in `http.HTTPStatus` (#127100)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
10 months agoMention loop_factory argument in docstring for asyncio.run() (#128288)
Andrew Svetlov [Fri, 27 Dec 2024 13:58:35 +0000 (14:58 +0100)] 
Mention loop_factory argument in docstring for asyncio.run() (#128288)

10 months agogh-125887: Update PyObject_HasAttr exception behavior (#125907)
Damien [Fri, 27 Dec 2024 01:57:55 +0000 (09:57 +0800)] 
gh-125887: Update PyObject_HasAttr exception behavior (#125907)

Update PyObject_HasAttr exception behavior

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
10 months agogh-127537: Add __class_getitem__ to the python implementation of functools.partial...
CF Bolz-Tereick [Fri, 27 Dec 2024 01:03:47 +0000 (02:03 +0100)] 
gh-127537: Add __class_getitem__ to the python implementation of functools.partial (#127537)

10 months agoRemove incorrect imports rationale comment in `http.server` (#128278)
Moshe Kaplan [Thu, 26 Dec 2024 21:53:37 +0000 (16:53 -0500)] 
Remove incorrect imports rationale comment in `http.server` (#128278)

Remove reference to gethostbyaddr(), because it's not actually used within this code.

10 months agogh-126868: Add freelist for compact ints to `_PyLong_New` (#128181)
Pieter Eendebak [Thu, 26 Dec 2024 15:17:22 +0000 (16:17 +0100)] 
gh-126868: Add freelist for compact ints to `_PyLong_New` (#128181)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
10 months agogh-87138: convert blake2b/2s types to heap types (#127669)
Bénédikt Tran [Thu, 26 Dec 2024 15:03:57 +0000 (16:03 +0100)] 
gh-87138: convert blake2b/2s types to heap types (#127669)

10 months agogh-124761: add `socket.SO_REUSEPORT_LB` (#124961)
Thomas Grainger [Thu, 26 Dec 2024 14:50:20 +0000 (14:50 +0000)] 
gh-124761: add `socket.SO_REUSEPORT_LB` (#124961)

10 months agoClean up redundant ifdef in list getitem (#128257)
da-woods [Thu, 26 Dec 2024 14:40:48 +0000 (14:40 +0000)] 
Clean up redundant ifdef in list getitem (#128257)

It's already inside a `Py_GIL_DISABLED` block so the `#else` clause is always unused.

10 months agoDocs: Fix comment out in `c-api/typeobj.rst` (#128266)
Yuki Kobayashi [Thu, 26 Dec 2024 14:39:44 +0000 (23:39 +0900)] 
Docs: Fix comment out in `c-api/typeobj.rst` (#128266)

10 months agogh-119786: Fix typos in `InternalDocs/frames.md` (#128275)
Yan Yanchii [Thu, 26 Dec 2024 14:39:15 +0000 (15:39 +0100)] 
gh-119786: Fix typos in `InternalDocs/frames.md` (#128275)

Fix typos in `InternalDocs/frames.md`

10 months agogh-127949: add docs for asyncio policy deprecation (#128269)
Kumar Aditya [Thu, 26 Dec 2024 14:32:23 +0000 (20:02 +0530)] 
gh-127949: add docs for asyncio policy deprecation (#128269)

10 months agogh-128198: Add missing error checks for usages of PyIter_Next() (GH-128199)
Yan Yanchii [Wed, 25 Dec 2024 17:42:04 +0000 (18:42 +0100)] 
gh-128198: Add missing error checks for usages of PyIter_Next() (GH-128199)

10 months agogh-128234: support emscripten and wasi in async contextlib tests by removing asyncio...
Thomas Grainger [Wed, 25 Dec 2024 13:23:44 +0000 (13:23 +0000)] 
gh-128234: support emscripten and wasi in async contextlib tests by removing asyncio from contextlib async tests (#95888)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
10 months agogh-128002: use internal llist implementation for asyncio tasks (#128256)
Kumar Aditya [Wed, 25 Dec 2024 12:21:27 +0000 (17:51 +0530)] 
gh-128002: use internal llist implementation for asyncio tasks  (#128256)

10 months agogh-128201: Fix ``DeprecationWarning`` in ``test_pdb`` (#128202)
Kirill Podoprigora [Wed, 25 Dec 2024 07:26:51 +0000 (09:26 +0200)] 
gh-128201: Fix ``DeprecationWarning`` in ``test_pdb`` (#128202)

10 months agogh-128035: Add ssl.HAS_PHA to detect libssl PHA support (GH-128036)
Will Childs-Klein [Tue, 24 Dec 2024 18:29:27 +0000 (12:29 -0600)] 
gh-128035: Add ssl.HAS_PHA to detect libssl PHA support (GH-128036)

* Add ssl.HAS_PHA to detect libssl Post-Handshake-Auth support

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
10 months agogh-128227: Regenerate `Doc/requirements-oldest-sphinx.txt` (#128228)
Bogdan Romanyuk [Tue, 24 Dec 2024 18:00:24 +0000 (21:00 +0300)] 
gh-128227: Regenerate `Doc/requirements-oldest-sphinx.txt` (#128228)

10 months agogh-127847: Fix position in the special-cased zipfile seek (#127856)
Dima Ryazanov [Tue, 24 Dec 2024 15:56:42 +0000 (07:56 -0800)] 
gh-127847: Fix position in the special-cased zipfile seek (#127856)

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
10 months agogh-127949: deprecate `asyncio.set_event_loop` (#128218)
Kumar Aditya [Tue, 24 Dec 2024 13:54:28 +0000 (19:24 +0530)] 
gh-127949: deprecate `asyncio.set_event_loop` (#128218)

Deprecate `asyncio.set_event_loop` to be removed in Python 3.16.

10 months agogh-128217: Validate the normalized_environment variable instead of the similarly...
Sergey Muraviov [Tue, 24 Dec 2024 13:06:41 +0000 (16:06 +0300)] 
gh-128217: Validate the normalized_environment variable instead of the similarly named function (GH-128220)

10 months agoAdd Windows version comments to the python manifest. (GH-127439)
AraHaan [Tue, 24 Dec 2024 13:01:21 +0000 (08:01 -0500)] 
Add Windows version comments to the python manifest. (GH-127439)