]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
22 months agogh-113744: Add a new IncompleteInputError exception to improve incomplete input detec...
Pablo Galindo Salgado [Tue, 30 Jan 2024 16:21:30 +0000 (16:21 +0000)] 
gh-113744: Add a new IncompleteInputError exception to improve incomplete input detection in the codeop module (#113745)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
22 months agogh-112919: Speed-up datetime, date and time.replace() (GH-112921)
Eugene Toder [Tue, 30 Jan 2024 15:19:46 +0000 (10:19 -0500)] 
gh-112919: Speed-up datetime, date and time.replace() (GH-112921)

Use argument clinic and call new_* functions directly. This speeds up
these functions 6x to 7.5x when calling with keyword arguments.

22 months agogh-109975: Copyedit "What's New in Python 3.13" (#114401)
Hugo van Kemenade [Tue, 30 Jan 2024 15:12:11 +0000 (17:12 +0200)] 
gh-109975: Copyedit "What's New in Python 3.13" (#114401)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
22 months agoGH-114610: Fix `pathlib._abc.PurePathBase.with_suffix('.ext')` handling of stems...
Barney Gale [Tue, 30 Jan 2024 14:25:16 +0000 (14:25 +0000)] 
GH-114610: Fix `pathlib._abc.PurePathBase.with_suffix('.ext')` handling of stems (#114613)

Raise `ValueError` if `with_suffix('.ext')` is called on a path without a
stem. Paths may only have a non-empty suffix if they also have a non-empty
stem.

ABC-only bugfix; no effect on public classes.

22 months agogh-114706: Allow QueueListener.stop() to be called more than once. (GH-114748)
Vinay Sajip [Tue, 30 Jan 2024 12:34:18 +0000 (12:34 +0000)] 
gh-114706: Allow QueueListener.stop() to be called more than once. (GH-114748)

22 months agogh-113732: Fix support of QUOTE_NOTNULL and QUOTE_STRINGS in csv.reader (GH-113738)
Serhiy Storchaka [Tue, 30 Jan 2024 12:21:12 +0000 (14:21 +0200)] 
gh-113732: Fix support of QUOTE_NOTNULL and QUOTE_STRINGS in csv.reader (GH-113738)

22 months agogh-103323: Remove current_fast_get() unused parameter (#114593)
Victor Stinner [Tue, 30 Jan 2024 10:47:58 +0000 (11:47 +0100)] 
gh-103323: Remove current_fast_get() unused parameter (#114593)

The current_fast_get() static inline function doesn't use its
'runtime' parameter, so just remove it.

22 months agoGH-80789: Get rid of the ``ensurepip`` infra for many wheels (#109245)
Sviatoslav Sydorenko (Святослав Сидоренко) [Tue, 30 Jan 2024 01:25:31 +0000 (02:25 +0100)] 
GH-80789: Get rid of the ``ensurepip`` infra for many wheels (#109245)

Co-authored-by: vstinner@python.org
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
22 months agoGH-113464: Make Brandt a codeowner for JIT stuff (GH-114739)
Brandt Bucher [Tue, 30 Jan 2024 00:29:54 +0000 (16:29 -0800)] 
GH-113464: Make Brandt a codeowner for JIT stuff (GH-114739)

22 months agogh-114569: Use PyMem_* APIs for non-PyObjects in compiler (#114587)
Erlend E. Aasland [Mon, 29 Jan 2024 23:04:34 +0000 (00:04 +0100)] 
gh-114569: Use PyMem_* APIs for non-PyObjects in compiler (#114587)

22 months agoSet `hosted_on` for Read the Docs builds (#114697)
Hugo van Kemenade [Mon, 29 Jan 2024 21:24:21 +0000 (23:24 +0200)] 
Set `hosted_on` for Read the Docs builds (#114697)

22 months agogh-114569: Use PyMem_* APIs for non-PyObjects in unicodeobject.c (#114690)
Erlend E. Aasland [Mon, 29 Jan 2024 20:48:49 +0000 (21:48 +0100)] 
gh-114569: Use PyMem_* APIs for non-PyObjects in unicodeobject.c (#114690)

22 months agoTaskGroup: Use explicit None check for cancellation error (#114708)
Matan Perelman [Mon, 29 Jan 2024 19:12:33 +0000 (21:12 +0200)] 
TaskGroup: Use explicit None check for cancellation error (#114708)

22 months agogh-114678: Fix incorrect deprecation warning for 'N' specifier in Decimal format...
Serhiy Storchaka [Mon, 29 Jan 2024 17:58:31 +0000 (19:58 +0200)] 
gh-114678: Fix incorrect deprecation warning for 'N' specifier in Decimal format (GH-114683)

Co-authored-by: Stefan Krah <skrah@bytereef.org>
22 months agogh-112075: Dictionary global version counter should use atomic increments (#114568)
Dino Viehland [Mon, 29 Jan 2024 17:47:54 +0000 (09:47 -0800)] 
gh-112075: Dictionary global version counter should use atomic increments (#114568)

Dictionary global version counter should use atomic increments

22 months agogh-112075: Use PyMem_* for allocating dict keys objects (#114543)
Dino Viehland [Mon, 29 Jan 2024 17:38:03 +0000 (09:38 -0800)] 
gh-112075: Use PyMem_* for allocating dict keys objects (#114543)

Use PyMem_* for keys allocation

22 months agogh-112240: Add option to calendar module CLI to specify the weekday to start each...
Steven Ward [Mon, 29 Jan 2024 16:58:21 +0000 (11:58 -0500)] 
gh-112240: Add option to calendar module CLI to specify the weekday to start each week (GH-112241)

22 months agoFix more references to datetime and time classes (GH-114717)
Serhiy Storchaka [Mon, 29 Jan 2024 16:20:13 +0000 (18:20 +0200)] 
Fix more references to datetime and time classes (GH-114717)

They could be confused with references to datetime and time modules.

22 months agogh-85984: Add POSIX pseudo-terminal functions. (GH-102413)
Soumendra Ganguly [Mon, 29 Jan 2024 16:10:28 +0000 (17:10 +0100)] 
gh-85984: Add POSIX pseudo-terminal functions. (GH-102413)

Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
22 months agoRemove limit in calendar CLI help message for year arg (GH-114719)
Steven Ward [Mon, 29 Jan 2024 16:00:15 +0000 (11:00 -0500)] 
Remove limit in calendar CLI help message for year arg (GH-114719)

The limit was removed in 66c88ce30ca2b23daa37038e1a3c0de98f241f50 (GH-4109).

22 months agogh-91325: Skip Stable ABI checks with Py_TRACE_REFS special build (GH-92046)
Petr Viktorin [Mon, 29 Jan 2024 15:45:31 +0000 (16:45 +0100)] 
gh-91325: Skip Stable ABI checks with Py_TRACE_REFS special build (GH-92046)

Skip Stable ABI checks with Py_TRACE_REFS special build

This build is not compatible with Py_LIMITED_API nor with
the stable ABI.

22 months agogh-112050: Adapt collections.deque to Argument Clinic (#113963)
mpage [Mon, 29 Jan 2024 15:08:23 +0000 (07:08 -0800)] 
gh-112050: Adapt collections.deque to Argument Clinic (#113963)

22 months agogh-101100: Fix datetime reference warnings (GH-114661)
Skip Montanaro [Mon, 29 Jan 2024 14:43:44 +0000 (08:43 -0600)] 
gh-101100: Fix datetime reference warnings (GH-114661)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
22 months agogh-101100: Fix Sphinx warnings in `whatsnew/2.2.rst` (#112366)
Hugo van Kemenade [Mon, 29 Jan 2024 13:12:19 +0000 (15:12 +0200)] 
gh-101100: Fix Sphinx warnings in `whatsnew/2.2.rst` (#112366)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
22 months agogh-101100: Fix sphinx warnings in `Doc/c-api/memoryview.rst` (GH-114669)
Nikita Sobolev [Mon, 29 Jan 2024 09:56:11 +0000 (12:56 +0300)] 
gh-101100: Fix sphinx warnings in `Doc/c-api/memoryview.rst` (GH-114669)

22 months agogh-110893: Improve the documentation for __future__ module (#114642)
Shantanu [Mon, 29 Jan 2024 09:37:28 +0000 (01:37 -0800)] 
gh-110893: Improve the documentation for __future__ module (#114642)

nedbat took issue with the phrasing "real module". I'm actually fine
with that phrasing, but I do think the `__future__` page should be clear
about the way in which the `__future__` module is special. (Yes, there
was a footnote linking to the future statements part of the reference,
but there should be upfront discussion).

I'm sympathetic to nedbat's claim that no one really cares about
`__future__._Feature`, so I've moved the interesting table up to the
top.

22 months agogh-114685: Fix incorrect use of PyBUF_READ in import.c (GH-114686)
Nikita Sobolev [Mon, 29 Jan 2024 09:37:06 +0000 (12:37 +0300)] 
gh-114685: Fix incorrect use of PyBUF_READ in import.c (GH-114686)

22 months agogh-109653: Improve import time of importlib.metadata / email.utils (#114664)
Shantanu [Mon, 29 Jan 2024 09:30:22 +0000 (01:30 -0800)] 
gh-109653: Improve import time of importlib.metadata / email.utils (#114664)

My criterion for delayed imports is that they're only worth it if the
majority of users of the module would benefit from it, otherwise you're
just moving latency around unpredictably.

mktime_tz is not used anywhere in the standard library and grep.app
indicates it's not got much use in the ecosystem either.

Distribution.files is not nearly as widely used as other
importlib.metadata APIs, so we defer the csv import.

Before:
```
λ hyperfine -w 8 './python -c "import importlib.metadata"'
Benchmark 1: ./python -c "import importlib.metadata"
  Time (mean ± σ):      65.1 ms ±   0.5 ms    [User: 55.3 ms, System: 9.8 ms]
  Range (min … max):    64.4 ms …  66.4 ms    44 runs
```

After:
```
λ hyperfine -w 8 './python -c "import importlib.metadata"'
Benchmark 1: ./python -c "import importlib.metadata"
  Time (mean ± σ):      62.0 ms ±   0.3 ms    [User: 52.5 ms, System: 9.6 ms]
  Range (min … max):    61.3 ms …  62.8 ms    46 runs
```

for about a 3ms saving with warm disk cache, maybe 7-11ms with cold disk
cache.

22 months agogh-89159: Add some TarFile attribute types (GH-114520)
Stanley [Mon, 29 Jan 2024 09:19:22 +0000 (01:19 -0800)] 
gh-89159: Add some TarFile attribute types  (GH-114520)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
22 months agoGH-113464: A JIT backend for tier 2 (GH-113465)
Brandt Bucher [Mon, 29 Jan 2024 02:52:58 +0000 (18:52 -0800)] 
GH-113464: A JIT backend for tier 2 (GH-113465)

Add an option (--enable-experimental-jit for configure-based builds
or --experimental-jit for PCbuild-based ones) to build an
*experimental* just-in-time compiler, based on copy-and-patch
(https://fredrikbk.com/publications/copy-and-patch.pdf).

See Tools/jit/README.md for more information, including how to install the required build-time tooling. Merry JIT-mas! ;)

22 months agoGH-113464: Add a JIT backend for tier 2 (GH-113465)
Brandt Bucher [Mon, 29 Jan 2024 02:48:48 +0000 (18:48 -0800)] 
GH-113464: Add a JIT backend for tier 2 (GH-113465)

Add an option (--enable-experimental-jit for configure-based builds
or --experimental-jit for PCbuild-based ones) to build an
*experimental* just-in-time compiler, based on copy-and-patch (https://fredrikbk.com/publications/copy-and-patch.pdf).

See Tools/jit/README.md for more information on how to install the required build-time tooling.

22 months agogh-55664: Add warning when creating a type using a namespace dictionary with non...
Furkan Onder [Sun, 28 Jan 2024 23:05:29 +0000 (02:05 +0300)] 
gh-55664: Add warning when creating a type using a namespace dictionary with non-string keys. (GH-105338)

Co-authored-by: Daniel Urban <durban@users.noreply.github.com>
22 months agogh-100734: Add 'Notable change in 3.11.x' to `whatsnew/3.11.rst` (#114657)
Hugo van Kemenade [Sun, 28 Jan 2024 20:28:25 +0000 (22:28 +0200)] 
gh-100734: Add 'Notable change in 3.11.x' to `whatsnew/3.11.rst` (#114657)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
22 months agoFix indentation in `__post_init__` documentation. (gh-114666)
Bhushan Mohanraj [Sun, 28 Jan 2024 20:10:32 +0000 (15:10 -0500)] 
Fix indentation in `__post_init__` documentation. (gh-114666)

22 months agoCorrection Skip Montanaro's email address (#114677)
Skip Montanaro [Sun, 28 Jan 2024 14:51:25 +0000 (08:51 -0600)] 
Correction Skip Montanaro's email address (#114677)

22 months agoUse bool in fileinput.input() docstring and tests for the inplace argument (GH-111998)
Ville Skyttä [Sat, 27 Jan 2024 21:47:55 +0000 (23:47 +0200)] 
Use bool in fileinput.input() docstring and tests for the inplace argument (GH-111998)

The `.rst` docs, most tests, and typeshed already use bool for it.

22 months agoGH-79634: Speed up pathlib globbing by removing `joinpath()` call. (#114623)
Barney Gale [Sat, 27 Jan 2024 19:59:51 +0000 (19:59 +0000)] 
GH-79634: Speed up pathlib globbing by removing `joinpath()` call. (#114623)

Remove `self.joinpath('')` call that should have been removed in 6313cdde.

This makes `PathBase.glob('')` yield itself *without* adding a trailing slash. It's hard to say whether this is more or less correct, but at least everything else is faster, and there's no behaviour change in the public classes where empty glob patterns are disallowed.

22 months agogh-114100: Remove superfluous writing to fd 1 in test_pty (GH-114647)
Serhiy Storchaka [Sat, 27 Jan 2024 16:38:17 +0000 (18:38 +0200)] 
gh-114100: Remove superfluous writing to fd 1 in test_pty (GH-114647)

22 months agogh-101100: Fix sphinx warnings in `reference/import.rst` (#114646)
Nikita Sobolev [Sat, 27 Jan 2024 14:30:21 +0000 (17:30 +0300)] 
gh-101100: Fix sphinx warnings in `reference/import.rst` (#114646)

22 months agogh-101100: Fix Sphinx warnings in `whatsnew/3.11.rst` and related (#114531)
Hugo van Kemenade [Sat, 27 Jan 2024 13:06:59 +0000 (15:06 +0200)] 
gh-101100: Fix Sphinx warnings in `whatsnew/3.11.rst` and related (#114531)

22 months agogh-113560: Improve docstrings for set.issubset() and set.issuperset() (GH-113562)
Charlie Zhao [Sat, 27 Jan 2024 09:53:01 +0000 (17:53 +0800)] 
gh-113560: Improve docstrings for set.issubset() and set.issuperset() (GH-113562)

22 months agogh-101100: Fix sphinx warnings in `library/email.mime.rst` (GH-114635)
Nikita Sobolev [Sat, 27 Jan 2024 08:45:40 +0000 (11:45 +0300)] 
gh-101100: Fix sphinx warnings in `library/email.mime.rst` (GH-114635)

22 months agoFix `c-api/file.rst` indexes (GH-114608)
Nikita Sobolev [Sat, 27 Jan 2024 08:45:07 +0000 (11:45 +0300)] 
Fix `c-api/file.rst` indexes (GH-114608)

22 months agoSimplify concurrent.futures.process code by using itertools.batched() (GH-114221)
NewUserHa [Sat, 27 Jan 2024 08:29:38 +0000 (16:29 +0800)] 
Simplify concurrent.futures.process code by using itertools.batched() (GH-114221)

22 months agogh-113445: Amend PyObject_RichCompareBool() docs (GH-113891)
Sergey B Kirpichev [Sat, 27 Jan 2024 07:55:33 +0000 (10:55 +0300)] 
gh-113445: Amend PyObject_RichCompareBool() docs (GH-113891)

22 months agogh-113055: Use pointer for interp->obmalloc state (gh-113412)
Neil Schemenauer [Sat, 27 Jan 2024 03:38:14 +0000 (19:38 -0800)] 
gh-113055: Use pointer for interp->obmalloc state (gh-113412)

For interpreters that share state with the main interpreter, this points
to the same static memory structure.  For interpreters with their own
obmalloc state, it is heap allocated.  Add free_obmalloc_arenas() which
will free the obmalloc arenas and radix tree structures for interpreters
with their own obmalloc state.

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
22 months agoCover OS-specific behaviour in `PurePathBase` and `PathBase` tests. (#114633)
Barney Gale [Sat, 27 Jan 2024 02:16:17 +0000 (02:16 +0000)] 
Cover OS-specific behaviour in `PurePathBase` and `PathBase` tests. (#114633)

Wherever possible, move tests for OS-specific behaviour from `PurePathTest`
and `PathTest` to `DummyPurePathTest` and `DummyPathTest`.

22 months agoCover OS-specific behaviour in `PurePath` and `Path` tests (#114632)
Barney Gale [Sat, 27 Jan 2024 01:30:25 +0000 (01:30 +0000)] 
Cover OS-specific behaviour in `PurePath` and `Path` tests (#114632)

Test Posix- and Windows-specific behaviour from `PurePathTest` and `PathTest`.

22 months agopathlib tests: annotate tests needing symlinks with decorator (#114625)
Barney Gale [Fri, 26 Jan 2024 22:29:28 +0000 (22:29 +0000)] 
pathlib tests: annotate tests needing symlinks with decorator (#114625)

Add `@needs_symlinks` decorator for tests that require symlink support in
the path class.

Also add `@needs_windows` and `@needs_posix` decorators for tests that
require a specific a specific path flavour. These aren't much used yet, but
will be later.

22 months agogh-114490: Add check for Mach-O linkage in Lib/platform.py (#114491)
Aiden Fox Ivey [Fri, 26 Jan 2024 20:36:50 +0000 (15:36 -0500)] 
gh-114490: Add check for Mach-O linkage in Lib/platform.py (#114491)

``platform.architecture()`` now returns the format of binaries (e.g. Mach-O) instead of the default empty string.

Co-authored-by: AN Long <aisk@users.noreply.github.com>
22 months agogh-114494: Change logging docstring to bool for exec_info (GH=114558)
Tristan Pank [Fri, 26 Jan 2024 19:48:22 +0000 (14:48 -0500)] 
gh-114494: Change logging docstring to bool for exec_info (GH=114558)

22 months agoAdd More Entries to CODEOWNERS (#114617)
Eric Snow [Fri, 26 Jan 2024 18:33:02 +0000 (11:33 -0700)] 
Add More Entries to CODEOWNERS (#114617)

22 months agogh-88569: add `ntpath.isreserved()` (#95486)
Barney Gale [Fri, 26 Jan 2024 18:14:24 +0000 (18:14 +0000)] 
gh-88569: add `ntpath.isreserved()` (#95486)

Add `ntpath.isreserved()`, which identifies reserved pathnames such as "NUL", "AUX" and "CON".

Deprecate `pathlib.PurePath.is_reserved()`.

---------

Co-authored-by: Eryk Sun <eryksun@gmail.com>
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
22 months agoDocs: rework the dbm.dumb introduction (#114550)
Erlend E. Aasland [Fri, 26 Jan 2024 18:12:48 +0000 (19:12 +0100)] 
Docs: rework the dbm.dumb introduction (#114550)

- consistently use correct parameter markup
- consistently use submodule name as database name
- improve accuracy of the dbm.dumb.open() spec
- remove dumbdbm class refs and replace them with generic "database object"
- use parameter list for dbm.dumb.open()

22 months agoDocument PyOS_strtoul and PyOS_strtol (GH-114048)
Sergey B Kirpichev [Fri, 26 Jan 2024 17:44:45 +0000 (20:44 +0300)] 
Document PyOS_strtoul and PyOS_strtol (GH-114048)

22 months agogh-114435: Allow test_stat_inaccessible_file() to have matching ino/dev (GH-114571)
Steve Dower [Fri, 26 Jan 2024 17:33:44 +0000 (17:33 +0000)] 
gh-114435: Allow test_stat_inaccessible_file() to have matching ino/dev (GH-114571)

This may occur if Windows allows reading stat information from a file even if the current user does not have access.

22 months agoUse Unicode unconditionally for _winapi.CreateFile (GH-114611)
Steve Dower [Fri, 26 Jan 2024 17:27:29 +0000 (17:27 +0000)] 
Use Unicode unconditionally for _winapi.CreateFile (GH-114611)

Currently it switches based on build settings, but argument clinic does not handle it correctly.

22 months agogh-112087: Make list_repr and list_length to be thread-safe (gh-114582)
Donghee Na [Fri, 26 Jan 2024 16:20:21 +0000 (01:20 +0900)] 
gh-112087: Make list_repr and list_length to be thread-safe (gh-114582)

22 months agogh-111968: Unify freelist naming schema to Eric's suggestion (gh-114581)
Donghee Na [Fri, 26 Jan 2024 15:25:16 +0000 (00:25 +0900)] 
gh-111968: Unify freelist naming schema to Eric's suggestion (gh-114581)

22 months agogh-77749: Fix inconsistent behavior of non-ASCII handling in EmailPolicy.fold() ...
Rito Takeuchi [Fri, 26 Jan 2024 15:19:41 +0000 (00:19 +0900)] 
gh-77749: Fix inconsistent behavior of non-ASCII handling in EmailPolicy.fold() (GH-6986)

It now always encodes non-ASCII characters in headers if utf8 is false.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
22 months agoDocs: mark up dbm.open() with param list (#114601)
Erlend E. Aasland [Fri, 26 Jan 2024 15:11:45 +0000 (16:11 +0100)] 
Docs: mark up dbm.open() with param list (#114601)

Also consolidate following paragraphs regarding database objects.

22 months agogh-114272: Allow _wmi audit test to succeed even if it times out (GH-114602)
Steve Dower [Fri, 26 Jan 2024 14:38:24 +0000 (14:38 +0000)] 
gh-114272: Allow _wmi audit test to succeed even if it times out (GH-114602)

22 months agoDocs: 'still' is a better word than 'nonetheless' (#114598)
Ned Batchelder [Fri, 26 Jan 2024 13:42:49 +0000 (08:42 -0500)] 
Docs: 'still' is a better word than 'nonetheless' (#114598)

22 months agoDocs: fix versionchanged directives for dbm.open() and dbm.whichdb() (#114594)
Erlend E. Aasland [Fri, 26 Jan 2024 12:36:37 +0000 (13:36 +0100)] 
Docs: fix versionchanged directives for dbm.open() and dbm.whichdb() (#114594)

22 months agoDocs: reword dbm.ndbm introduction (#114549)
Erlend E. Aasland [Fri, 26 Jan 2024 12:35:56 +0000 (13:35 +0100)] 
Docs: reword dbm.ndbm introduction (#114549)

- add abbreviation directives for NDBM and GDBM
- consistently spell NDBM as NDBM
- silence broken ndbm class refs
- improve accuracy of dbm.ndbm.open() spec
- use replacement text for NDBM/GDBM file format incompatibility note

22 months agoDocs: rework dbm introduction (#114551)
Erlend E. Aasland [Fri, 26 Jan 2024 10:15:34 +0000 (11:15 +0100)] 
Docs: rework dbm introduction (#114551)

- add refs to other parts of the docs (dict, bytes, etc.)
- clarify whichdb() return value by using list markup
- silence refs to example or generic submodule methods (keys, get, etc.)

22 months agogh-114569: Use PyMem_* APIs for most non-PyObject uses (#114574)
Erlend E. Aasland [Fri, 26 Jan 2024 10:11:35 +0000 (11:11 +0100)] 
gh-114569: Use PyMem_* APIs for most non-PyObject uses (#114574)

Fix usage in Modules, Objects, and Parser subdirectories.

22 months agogh-114312: Fix rare event counter tests on aarch64 (GH-114554)
Michael Droettboom [Fri, 26 Jan 2024 10:10:03 +0000 (05:10 -0500)] 
gh-114312: Fix rare event counter tests on aarch64 (GH-114554)

22 months agoDocs: reword dbm.gnu introduction (#114548)
Erlend E. Aasland [Fri, 26 Jan 2024 10:05:08 +0000 (11:05 +0100)] 
Docs: reword dbm.gnu introduction (#114548)

Also...
- consistently spell GDBM as GDBM
- silence gdbm class refs
- improve accuracy of dbm.gdbm.open() spec

22 months agogh-101100: Fix sphinx warnings in `c-api/file.rst` (#114546)
Nikita Sobolev [Fri, 26 Jan 2024 09:55:22 +0000 (12:55 +0300)] 
gh-101100: Fix sphinx warnings in `c-api/file.rst` (#114546)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
22 months agogh-114250: Fetch metadata for pip and its vendored dependencies from PyPI (#114450)
Seth Michael Larson [Fri, 26 Jan 2024 09:48:13 +0000 (03:48 -0600)] 
gh-114250: Fetch metadata for pip and its vendored dependencies from PyPI (#114450)

22 months agogh-112451: Prohibit subclassing of datetime.timezone. (#114190)
Mariusz Felisiak [Fri, 26 Jan 2024 08:33:13 +0000 (09:33 +0100)] 
gh-112451: Prohibit subclassing of datetime.timezone. (#114190)

This is consistent with C-extension datetime.timezone.

22 months agoGH-73435: Add `pathlib.PurePath.full_match()` (#114350)
Barney Gale [Fri, 26 Jan 2024 01:12:46 +0000 (01:12 +0000)] 
GH-73435: Add `pathlib.PurePath.full_match()` (#114350)

In 49f90ba we added support for the recursive wildcard `**` in
`pathlib.PurePath.match()`. This should allow arbitrary prefix and suffix
matching, like `p.match('foo/**')` or `p.match('**/foo')`, but there's a
problem: for relative patterns only, `match()` implicitly inserts a `**`
token on the left hand side, causing all patterns to match from the right.
As a result, it's impossible to match relative patterns from the left:
`PurePath('foo/bar').match('bar/**')` is true!

This commit reverts the changes to `match()`, and instead adds a new
`full_match()` method that:

- Allows empty patterns
- Supports the recursive wildcard `**`
- Matches the *entire* path when given a relative pattern

22 months agoAdd CODEOWNERS for dbm (gh-114555)
Donghee Na [Thu, 25 Jan 2024 20:49:37 +0000 (05:49 +0900)] 
Add CODEOWNERS for dbm (gh-114555)

22 months agogh-107901: compiler replaces POP_BLOCK instruction by NOPs before optimisations ...
Irit Katriel [Thu, 25 Jan 2024 20:06:48 +0000 (20:06 +0000)] 
gh-107901: compiler replaces POP_BLOCK instruction by NOPs before optimisations (#114530)

22 months agogh-114561: Mark some tests in ``test_wincosoleio`` with `requires_resource('console...
Kirill Podoprigora [Thu, 25 Jan 2024 20:00:52 +0000 (23:00 +0300)] 
gh-114561: Mark some tests in ``test_wincosoleio`` with `requires_resource('console')` decorator  (GH-114565)

22 months agogh-114315: Make `threading.Lock` a real class, not a factory function (#114479)
Nikita Sobolev [Thu, 25 Jan 2024 19:46:32 +0000 (22:46 +0300)] 
gh-114315: Make `threading.Lock` a real class, not a factory function (#114479)

`threading.Lock` is now the underlying class and is constructable rather than the old
factory function. This allows for type annotations to refer to it which had no non-ugly
way to be expressed prior to this.

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
22 months agogh-112529: Implement GC for free-threaded builds (#114262)
Sam Gross [Thu, 25 Jan 2024 18:27:36 +0000 (13:27 -0500)] 
gh-112529: Implement GC for free-threaded builds (#114262)

* gh-112529: Implement GC for free-threaded builds

This implements a mark and sweep GC for the free-threaded builds of
CPython. The implementation relies on mimalloc to find GC tracked
objects (i.e., "containers").

22 months agogh-112075: Add try-incref functions from nogil branch for use in dict thread safety...
Dino Viehland [Thu, 25 Jan 2024 17:34:03 +0000 (09:34 -0800)] 
gh-112075: Add try-incref functions from nogil branch for use in dict thread safety (#114512)

* Bring in a subset of biased reference counting:
https://github.com/colesbury/nogil/commit/b6b12a9a94e

The NoGIL branch has functions for attempting to do an incref on an object which may or may not be in flight. This just brings those functions over so that they will be usable from in the dict implementation to get items w/o holding a lock.

There's a handful of small simple modifications:

    Adding inline to the force inline functions to avoid a warning, and switching from _Py_ALWAYS_INLINE to Py_ALWAYS_INLINE as that's available
    Remove _Py_REF_LOCAL_SHIFT as it doesn't exist yet (and is currently 0 in the 3.12 nogil branch anyway)
    ob_ref_shared is currently Py_ssize_t and not uint32_t, so use that
    _PY_LIKELY doesn't exist, so drop it
    _Py_ThreadLocal becomes _Py_IsOwnedByCurrentThread
    Add '_PyInterpreterState_GET()' to _Py_IncRefTotal calls.

Co-Authored-By: Sam Gross <colesbury@gmail.com>
22 months agogh-111051: Check if file is modifed during debugging in `pdb` (#111052)
Tian Gao [Thu, 25 Jan 2024 16:48:50 +0000 (08:48 -0800)] 
gh-111051: Check if file is modifed during debugging in `pdb` (#111052)

22 months agoDoc/library/sys.monitoring.rst: remove contradictory paragraph. (GH-113619)
Ned Batchelder [Thu, 25 Jan 2024 14:38:43 +0000 (09:38 -0500)] 
Doc/library/sys.monitoring.rst: remove contradictory paragraph. (GH-113619)

22 months agogh-77465: Increase test coverage for the numbers module (GH-111738)
AN Long [Thu, 25 Jan 2024 14:35:05 +0000 (22:35 +0800)] 
gh-77465: Increase test coverage for the numbers module (GH-111738)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
22 months agogh-114265: remove i_loc_propagated, jump threading does not consider line numbers...
Irit Katriel [Thu, 25 Jan 2024 12:54:19 +0000 (12:54 +0000)] 
gh-114265: remove i_loc_propagated, jump threading does not consider line numbers anymore (#114535)

22 months agogh-114312: Collect stats for unlikely events (GH-114493)
Michael Droettboom [Thu, 25 Jan 2024 11:10:51 +0000 (06:10 -0500)] 
gh-114312: Collect stats for unlikely events (GH-114493)

22 months agogh-114272: Fix or skip tests that fail due to spaces in paths (GH-114451)
Steve Dower [Thu, 25 Jan 2024 00:38:34 +0000 (00:38 +0000)] 
gh-114272: Fix or skip tests that fail due to spaces in paths (GH-114451)

22 months agogh-100107: Make py.exe launcher ignore app aliases that launch Microsoft Store (GH...
Vincent Cunningham [Thu, 25 Jan 2024 00:23:28 +0000 (16:23 -0800)] 
gh-100107: Make py.exe launcher ignore app aliases that launch Microsoft Store (GH-114358)

22 months agogh-108731: Add description of __slots__ to MemberDescriptorType docs (GH-108745)
plokmijnuhby [Wed, 24 Jan 2024 19:58:34 +0000 (19:58 +0000)] 
gh-108731: Add description of __slots__ to MemberDescriptorType docs (GH-108745)

22 months agoUpdate outdated comment in ``Python/bytecodes.c`` (#114522)
Kirill Podoprigora [Wed, 24 Jan 2024 17:14:15 +0000 (20:14 +0300)] 
Update outdated comment in ``Python/bytecodes.c`` (#114522)

22 months agoGH-112354: `END_FOR` instruction to only pop one value. (GH-114247)
Mark Shannon [Wed, 24 Jan 2024 15:10:17 +0000 (15:10 +0000)] 
GH-112354: `END_FOR` instruction to only pop one value. (GH-114247)

* Compiler emits END_FOR; POP_TOP instead of END_FOR. To support tier 2 side exits in loops.

22 months agoDocs: mark up the FTP_TLS() docs with param list (#114510)
Erlend E. Aasland [Wed, 24 Jan 2024 15:06:14 +0000 (16:06 +0100)] 
Docs: mark up the FTP_TLS() docs with param list (#114510)

Also turn sentence about prot_p() into a note.

22 months agogh-104360: remove reference to removed module-level wrap_socket (GH-104361)
Thomas Grainger [Wed, 24 Jan 2024 14:24:00 +0000 (14:24 +0000)] 
gh-104360: remove reference to removed module-level wrap_socket (GH-104361)

* remove reference to removed module-level wrap_socket
* drive by typo fix

22 months agogh-101100: Fix Sphinx warnings in `c-api/structures.rst` (#113564)
Hugo van Kemenade [Wed, 24 Jan 2024 13:40:09 +0000 (15:40 +0200)] 
gh-101100: Fix Sphinx warnings in `c-api/structures.rst` (#113564)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
22 months agogh-101100: Fix sphinx warnings in `concurrent.futures.rst` (#114521)
Nikita Sobolev [Wed, 24 Jan 2024 13:30:50 +0000 (16:30 +0300)] 
gh-101100: Fix sphinx warnings in `concurrent.futures.rst` (#114521)

22 months agoGH-113710: Add a tier 2 peephole optimization pass. (GH-114487)
Mark Shannon [Wed, 24 Jan 2024 12:08:31 +0000 (12:08 +0000)] 
GH-113710: Add a tier 2 peephole optimization pass. (GH-114487)

* Convert _LOAD_CONST to inline versions

* Remove PEP 523 checks

22 months agogh-101100: Fix sphinx warnings in `asyncio-task.rst` (#114469)
Nikita Sobolev [Wed, 24 Jan 2024 07:23:34 +0000 (10:23 +0300)] 
gh-101100: Fix sphinx warnings in `asyncio-task.rst` (#114469)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
22 months agogh-113205: test_multiprocessing.test_terminate: Give tasks a chance to start (GH...
Serhiy Storchaka [Wed, 24 Jan 2024 07:13:09 +0000 (09:13 +0200)] 
gh-113205: test_multiprocessing.test_terminate: Give tasks a chance to start (GH-114249)

22 months agoFix a typo in the contextlib documentation (#114507)
Daniel Hollas [Wed, 24 Jan 2024 04:16:31 +0000 (04:16 +0000)] 
Fix a typo in the contextlib documentation (#114507)

22 months agoGH-114456: lower the recursion limit under WASI for debug builds (GH-114457)
Brett Cannon [Tue, 23 Jan 2024 23:48:14 +0000 (15:48 -0800)] 
GH-114456: lower the recursion limit under WASI for debug builds (GH-114457)

Testing under wasmtime 16.0.0 w/ code from https://github.com/python/cpython/issues/114413 is how the value was found.

22 months agogh-112075: Adapt more dict methods to Argument Clinic (#114256)
Dino Viehland [Tue, 23 Jan 2024 22:10:04 +0000 (14:10 -0800)] 
gh-112075: Adapt more dict methods to Argument Clinic (#114256)

* Move more dict objects to argument clinic

* Improve doc strings

* More doc string improvements

* Update Objects/dictobject.c

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* Update Objects/dictobject.c

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* Update Objects/dictobject.c

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* Update Objects/dictobject.c

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* Update Objects/dictobject.c

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* Update Objects/dictobject.c

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* Update Objects/dictobject.c

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
---------

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
22 months agogh-114492: Initialize struct termios before calling tcgetattr() (GH-114495)
Serhiy Storchaka [Tue, 23 Jan 2024 21:27:04 +0000 (23:27 +0200)] 
gh-114492: Initialize struct termios before calling tcgetattr() (GH-114495)

On Alpine Linux it could leave some field non-initialized.