]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agoGH-118447: Fix FreeBSD test failures. (#119170)
Barney Gale [Sun, 19 May 2024 15:39:00 +0000 (16:39 +0100)] 
GH-118447: Fix FreeBSD test failures. (#119170)

Apparently only macOS requires read permission to call `readlink()` on a
symlink.

2 years agoGH-119146: Don't run JIT CI on unrelated changes (GH-119147)
Savannah Ostrowski [Sun, 19 May 2024 12:59:12 +0000 (08:59 -0400)] 
GH-119146: Don't run JIT CI on unrelated changes  (GH-119147)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agomarshal docs: Remove reference to "Sun" (#119161)
Jelle Zijlstra [Sun, 19 May 2024 02:15:14 +0000 (22:15 -0400)] 
marshal docs: Remove reference to "Sun" (#119161)

Nobody has been using a Sun machine for a long time. When I saw
this sentence in a lightning talk just now, I thought it was talking
about sending Python code on a spacecraft.

2 years agoTry to repair oddball test bots timing out in test_int (#119166)
Tim Peters [Sun, 19 May 2024 01:54:23 +0000 (20:54 -0500)] 
Try to repair oddball test bots timing out in test_int (#119166)

Various test bots (outside the ones GH normally runs) are timing out during test_int after ecd8664 (asymptotically faster str->int). Best guess is that they don't build the C _decimal module. So require that module in the most likely tests to time out then. Flying mostly blind, though!

2 years agogh-118750: Asymptotically faster `int(string)` (#118751)
Tim Peters [Sun, 19 May 2024 00:19:57 +0000 (19:19 -0500)] 
gh-118750: Asymptotically faster `int(string)` (#118751)

Asymptotically faster (O(n log n)) str->int for very large strings, leveraging the faster multiplication scheme in the C-coded `_decimal` when available. This is used instead of the current Karatsuba-limited method starting at 2 million digits.

Lots of opportunity remains for fine-tuning. Good targets include changing BYTELIM, and possibly changing the internal output base (from 256 to a higher number of bytes).

Doing this was substantial work, and many of the new lines are actually comments giving correctness proofs. The obvious approaches sticking to integers were too slow to be useful, so this is doing variable-precision decimal floating-point arithmetic. Much faster, but worst-possible rounding errors have to be wholly accounted for, using as little precision as possible.

Special thanks to Serhiy Storchaka for asking many good questions in his code reviews!

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: sstandre <43125375+sstandre@users.noreply.github.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2 years agoGH-118447: Fix handling of unreadable symlinks in `os.path.realpath()` (#118489)
Barney Gale [Sat, 18 May 2024 22:40:51 +0000 (23:40 +0100)] 
GH-118447: Fix handling of unreadable symlinks in `os.path.realpath()` (#118489)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2 years agogh-119050: Add type hints to libregrtest/results.py (#119144)
Victor Stinner [Sat, 18 May 2024 20:21:05 +0000 (16:21 -0400)] 
gh-119050: Add type hints to libregrtest/results.py (#119144)

Sort also 'omitted' in TestResults.display_result().

2 years agogh-119132: Update sys.version to identify free-threaded or not. (gh-119134)
Donghee Na [Sat, 18 May 2024 19:44:40 +0000 (15:44 -0400)] 
gh-119132: Update sys.version to identify free-threaded or not. (gh-119134)

2 years agodocs: make mimalloc license text literal (#119046)
Rafael Fontenelle [Sat, 18 May 2024 16:22:54 +0000 (13:22 -0300)] 
docs: make mimalloc license text literal (#119046)

2 years agogh-119132: Log sys._is_gil_enabled() in test.pythoninfo (#119140)
Victor Stinner [Sat, 18 May 2024 13:24:22 +0000 (09:24 -0400)] 
gh-119132: Log sys._is_gil_enabled() in test.pythoninfo (#119140)

2 years agogh-119078: Clarify venv tutorial (GH-119129)
Nice Zombies [Sat, 18 May 2024 11:44:02 +0000 (13:44 +0200)] 
gh-119078: Clarify venv tutorial (GH-119129)

2 years agoMinor improvements to the docs for itertools.tee() (gh-119135)
Raymond Hettinger [Sat, 18 May 2024 06:32:34 +0000 (01:32 -0500)] 
Minor improvements to the docs for itertools.tee() (gh-119135)

2 years agogh-119049: Defer `import warnings` in `pathlib._local` (#119111)
Kirill Podoprigora [Fri, 17 May 2024 16:12:02 +0000 (19:12 +0300)] 
gh-119049: Defer `import warnings` in `pathlib._local` (#119111)

2 years agogh-112066: Fix versionadded in PyDict_SetDefaultRef docs (#118696)
Lysandros Nikolaou [Fri, 17 May 2024 16:10:21 +0000 (12:10 -0400)] 
gh-112066: Fix versionadded in PyDict_SetDefaultRef docs (#118696)

2 years agoFix typos in documentation (#119092)
Xie Yanbo [Fri, 17 May 2024 10:37:35 +0000 (18:37 +0800)] 
Fix typos in documentation (#119092)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoImprove `pyrepl` type-annotation coverage (#119081)
Alex Waygood [Fri, 17 May 2024 10:13:24 +0000 (06:13 -0400)] 
Improve `pyrepl` type-annotation coverage (#119081)

2 years agogh-119049: Fix incorrect display of warning which is constructed by C API (GH-119063)
Kirill Podoprigora [Thu, 16 May 2024 20:27:59 +0000 (23:27 +0300)] 
gh-119049: Fix incorrect display of warning which is constructed by C API (GH-119063)

The source line was not displayed if the warnings module had not yet
been imported.

2 years agoGH-118943: Fix a race condition when generating jit_stencils.h (GH-118957)
Brandt Bucher [Thu, 16 May 2024 16:11:42 +0000 (12:11 -0400)] 
GH-118943: Fix a race condition when generating jit_stencils.h (GH-118957)

2 years agoExplain how to install LLVM on Fedora (GH-118983)
Miro Hrončok [Thu, 16 May 2024 16:09:52 +0000 (18:09 +0200)] 
Explain how to install LLVM on Fedora (GH-118983)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2 years agogh-108267: Fix object.__setattr__ regression in dataclasses docs (#119082)
Shantanu [Thu, 16 May 2024 13:39:37 +0000 (06:39 -0700)] 
gh-108267: Fix object.__setattr__ regression in dataclasses docs (#119082)

2 years agoAdd Tkinter tests for different events (GH-118778)
Serhiy Storchaka [Thu, 16 May 2024 08:16:46 +0000 (11:16 +0300)] 
Add Tkinter tests for different events (GH-118778)

2 years agogh-119064: Use os_helper.FakePath instead of pathlib.Path in tests (GH-119065)
Serhiy Storchaka [Thu, 16 May 2024 07:25:10 +0000 (10:25 +0300)] 
gh-119064: Use os_helper.FakePath instead of pathlib.Path in tests (GH-119065)

2 years agoFix typos in test_buffer.py and update numpy issue links (#118963)
Wulian233 [Thu, 16 May 2024 05:16:34 +0000 (13:16 +0800)] 
Fix typos in test_buffer.py and update numpy issue links (#118963)

2 years agoUse literal syntax in origin property (#119029)
Rafael Fontenelle [Thu, 16 May 2024 05:13:47 +0000 (02:13 -0300)] 
Use literal syntax in origin property (#119029)

2 years agoDocs: fix typos in documentation (gh-118941)
Xie Yanbo [Wed, 15 May 2024 23:38:32 +0000 (07:38 +0800)] 
Docs: fix typos in documentation (gh-118941)

2 years agogh-119009: Add gettext target (#119006)
Rafael Fontenelle [Wed, 15 May 2024 18:13:52 +0000 (15:13 -0300)] 
gh-119009: Add gettext target (#119006)

2 years agogh-118760: Fix errors in calling Tkinter bindings on Windows (GH-118782)
Serhiy Storchaka [Wed, 15 May 2024 16:49:00 +0000 (19:49 +0300)] 
gh-118760: Fix errors in calling Tkinter bindings on Windows (GH-118782)

For unknown reasons some arguments for Tkinter binding can be created
as a 1-tuple containing a Tcl_Obj when wantobjects is 2.

2 years agoRemove references to private symbols from zipimport module docstring (GH-119015)
Thomas Grainger [Wed, 15 May 2024 16:21:52 +0000 (17:21 +0100)] 
Remove references to private symbols from zipimport module docstring (GH-119015)

2 years agogh-118486: Simplify test_win32_mkdir_700 to check the exact ACL (GH-119056)
Steve Dower [Wed, 15 May 2024 10:59:41 +0000 (11:59 +0100)] 
gh-118486: Simplify test_win32_mkdir_700 to check the exact ACL (GH-119056)

2 years ago3.13 What's New: Add PEP 702 (#118922)
Jelle Zijlstra [Wed, 15 May 2024 02:39:12 +0000 (22:39 -0400)] 
3.13 What's New: Add PEP 702 (#118922)

I honestly forgot this slipped into 3.13, but I think it's worth highlighting more, as it is a PEP-sized change that makes the type system significantly more powerful.

@Yhg1s I think it's also worth mentioning in your release announcements.

2 years agoGH-74033: Drop deprecated `pathlib.Path` keyword arguments (#118793)
Barney Gale [Tue, 14 May 2024 20:14:07 +0000 (21:14 +0100)] 
GH-74033: Drop deprecated `pathlib.Path` keyword arguments (#118793)

Remove support for supplying keyword arguments to `pathlib.Path()`. This
has been deprecated since Python 3.12.

2 years agoGH-101357: Suppress `OSError` from `pathlib.Path.exists()` and `is_*()` (#118243)
Barney Gale [Tue, 14 May 2024 17:53:15 +0000 (18:53 +0100)] 
GH-101357: Suppress `OSError` from `pathlib.Path.exists()` and `is_*()` (#118243)

Suppress all `OSError` exceptions from `pathlib.Path.exists()` and `is_*()`
rather than a selection of more common errors as we do presently. Also
adjust the implementations to call `os.path.exists()` etc, which are much
faster on Windows thanks to GH-101196.

2 years agogh-118928: sqlite3: disallow sequences of params with named placeholders (#118929)
Erlend E. Aasland [Tue, 14 May 2024 16:10:55 +0000 (12:10 -0400)] 
gh-118928: sqlite3: disallow sequences of params with named placeholders (#118929)

Follow-up of gh-101693. The previous DeprecationWarning is replaced with
raising sqlite3.ProgrammingError.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 years agoMisc improvements to the itertools docs (gh-119040)
Raymond Hettinger [Tue, 14 May 2024 15:18:19 +0000 (10:18 -0500)] 
Misc improvements to the itertools docs (gh-119040)

2 years agotyping tests: remove some unnecessary uses of `exec()` (#119005)
Alex Waygood [Tue, 14 May 2024 14:16:14 +0000 (10:16 -0400)] 
typing tests: remove some unnecessary uses of `exec()` (#119005)

2 years agoAdd yet few cases for urlparse/urlunparse roundtrip tests (GH-119031)
Serhiy Storchaka [Tue, 14 May 2024 13:59:21 +0000 (16:59 +0300)] 
Add yet few cases for urlparse/urlunparse roundtrip tests (GH-119031)

Add yet few cases for urlparse/urlunparse tests

2 years agogh-67693: Fix urlunparse() and urlunsplit() for URIs with path starting with multiple...
Serhiy Storchaka [Tue, 14 May 2024 09:24:37 +0000 (12:24 +0300)] 
gh-67693: Fix urlunparse() and urlunsplit() for URIs with path starting with multiple slashes and no authority (GH-113563)

2 years agoGH-118836: Fix JIT build error when SHT_NOTE section is present (GH-119000)
Michał Górny [Mon, 13 May 2024 21:37:02 +0000 (23:37 +0200)] 
GH-118836: Fix JIT build error when SHT_NOTE section is present (GH-119000)

2 years agogh-118998: Handle errors correctly in `tmtotuple` in `timemodule` (#118999)
Nikita Sobolev [Mon, 13 May 2024 21:20:59 +0000 (00:20 +0300)] 
gh-118998: Handle errors correctly in `tmtotuple` in `timemodule` (#118999)

2 years agogh-119010: Adds docs about `__type_params__` to `functools.update_wrapper` (#119012)
Nikita Sobolev [Mon, 13 May 2024 20:01:05 +0000 (23:01 +0300)] 
gh-119010: Adds docs about `__type_params__` to `functools.update_wrapper` (#119012)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years agogh-117873: Revert _posixshmem.shm_open() change (#118901)
Victor Stinner [Mon, 13 May 2024 14:03:52 +0000 (16:03 +0200)] 
gh-117873: Revert _posixshmem.shm_open() change (#118901)

2 years agogh-58933: Make pdb return to caller frame correctly when f_trace is not set (#118979)
Tian Gao [Mon, 13 May 2024 12:38:21 +0000 (05:38 -0700)] 
gh-58933: Make pdb return to caller frame correctly when f_trace is not set (#118979)

2 years agogh-118876: Ensure PC/layout sets ns.temp before using it (GH-118880)
I-Shen Leong [Mon, 13 May 2024 11:30:16 +0000 (04:30 -0700)] 
gh-118876: Ensure PC/layout sets ns.temp before using it (GH-118880)

Fixes an AttributeError that occurs when checking if ns.temp is an absolute path during building from source on Windows.

2 years agoImprove the `rmtree` doc for `dir_fd` param addition in 3.11 (#118964)
Nikita Sobolev [Mon, 13 May 2024 11:04:14 +0000 (14:04 +0300)] 
Improve the `rmtree` doc for `dir_fd` param addition in 3.11 (#118964)

2 years agogh-87106: Fix inspect.signature.bind() handling of positional-only arguments with...
Jacob Walls [Mon, 13 May 2024 07:56:09 +0000 (03:56 -0400)] 
gh-87106: Fix inspect.signature.bind() handling of positional-only arguments with **kwargs (GH-103404)

2 years agoItertools docs: fix parameter names and indentation in Python equivalents (gh-118977)
pochmann3 [Sun, 12 May 2024 21:11:38 +0000 (23:11 +0200)] 
Itertools docs: fix parameter names and indentation in Python equivalents (gh-118977)

2 years agogh-118899: Add tests for `NotImplemented` attribute access (#118902)
Nikita Sobolev [Sun, 12 May 2024 14:00:49 +0000 (17:00 +0300)] 
gh-118899: Add tests for `NotImplemented` attribute access (#118902)

2 years agoGH-118844: Fix build failures when combining --disable-gil with --enable-experimental...
Savannah Ostrowski [Sat, 11 May 2024 23:19:31 +0000 (16:19 -0700)] 
GH-118844: Fix build failures when combining --disable-gil with --enable-experimental-jit (GH-118935)

2 years agogh-117655: Prevent `test_strptime` from raising a DeprecationWarning (GH-117668)
Nice Zombies [Sat, 11 May 2024 21:46:07 +0000 (23:46 +0200)] 
gh-117655: Prevent `test_strptime` from raising a DeprecationWarning (GH-117668)

* Fix `test_strptime` raises a DeprecationWarning
* Ignore deprecation warnings where appropriate.
* Update Lib/test/datetimetester.py

This is follow on work to silence unnecessary warnings from the test suite that changes for https://github.com/python/cpython/issues/70647 added.

2 years agogh-118932: ChainMap.__contains__ performance improvement (gh-118946)
d.grigonis [Sat, 11 May 2024 20:55:23 +0000 (23:55 +0300)] 
gh-118932: ChainMap.__contains__ performance improvement (gh-118946)

2 years agoDocs: Fix SOURCE_URI (#118945)
Nice Zombies [Sat, 11 May 2024 11:47:45 +0000 (13:47 +0200)] 
Docs: Fix SOURCE_URI (#118945)

2 years agogh-118921: Add `copy()` method for `FrameLocalsProxy` (#118923)
Tian Gao [Fri, 10 May 2024 22:53:10 +0000 (15:53 -0700)] 
gh-118921: Add `copy()` method for `FrameLocalsProxy` (#118923)

2 years agogh-117657: Log TSAN warnings to separate files and archive them (#118747)
mpage [Fri, 10 May 2024 21:54:23 +0000 (14:54 -0700)] 
gh-117657: Log TSAN warnings to separate files and archive them (#118747)

This ensures we don't lose races that occur in subprocesses or
interleave races from workers running in parallel.

Log files are collected and packaged into a zipfile that can be
downloaded from the "Artifacts" section of the workflow run.

2 years agogh-118924: Remove `sqlite3.version` and `sqlite3.version_info` (#118925)
Hugo van Kemenade [Fri, 10 May 2024 20:42:34 +0000 (23:42 +0300)] 
gh-118924: Remove `sqlite3.version` and `sqlite3.version_info` (#118925)

2 years agogh-118846: Fix free-threading test failures when run sequentially (#118864)
Sam Gross [Fri, 10 May 2024 20:29:29 +0000 (16:29 -0400)] 
gh-118846: Fix free-threading test failures when run sequentially (#118864)

The free-threaded build currently immortalizes some objects once the
first thread is started. This can lead to test failures depending on the
order in which tests are run. This PR addresses those failures by
suppressing immortalization or skipping the affected tests.

2 years agogh-118702: Implement vectorcall for BaseException (#118703)
Victor Stinner [Fri, 10 May 2024 19:08:24 +0000 (21:08 +0200)] 
gh-118702: Implement vectorcall for BaseException (#118703)

* BaseException_vectorcall() now creates a tuple from 'args' array.
* Creation an exception using BaseException_vectorcall() is now a
  single function call, rather than having to call
  BaseException_new() and then BaseException_init().
  Calling BaseException_init() is inefficient since it overrides
  the 'args' attribute.
* _PyErr_SetKeyError() now uses PyObject_CallOneArg() to create the
  KeyError instance to use BaseException_vectorcall().

2 years agoRename typing._collect_parameters (#118900)
Jelle Zijlstra [Fri, 10 May 2024 16:55:49 +0000 (09:55 -0700)] 
Rename typing._collect_parameters (#118900)

Unfortunately, released versions of typing_extensions
monkeypatch this function without the extra parameter, which makes
it so things break badly if current main is used with typing_extensions.

Fortunately, the monkeypatching is not needed on Python 3.13, because CPython
now implements PEP 696. By renaming the function, we prevent the monkeypatch
from breaking typing.py internals.

We keep the old name (raising a DeprecationWarning) to help other external users who call it.

2 years agoGH-118910: Less boilerplate in the tier 2 optimizer (#118913)
Mark Shannon [Fri, 10 May 2024 16:43:23 +0000 (17:43 +0100)] 
GH-118910: Less boilerplate in the tier 2 optimizer (#118913)

2 years agogh-118771: Ensure names defined in optimizer.h start with Py/_Py (GH-118825)
Petr Viktorin [Fri, 10 May 2024 16:20:12 +0000 (18:20 +0200)] 
gh-118771: Ensure names defined in optimizer.h start with Py/_Py (GH-118825)

2 years agoGH-78707: Drop deprecated `pathlib.PurePath.[is_]relative_to()` arguments (#118780)
Barney Gale [Fri, 10 May 2024 15:53:46 +0000 (16:53 +0100)] 
GH-78707: Drop deprecated `pathlib.PurePath.[is_]relative_to()` arguments (#118780)

Remove support for supplying additional positional arguments to
`PurePath.relative_to()` and `is_relative_to()`. This has been deprecated
since Python 3.12.

2 years agogh-118895: Call PyType_Ready() on typing.NoDefault (#118897)
Jelle Zijlstra [Fri, 10 May 2024 15:42:00 +0000 (08:42 -0700)] 
gh-118895: Call PyType_Ready() on typing.NoDefault (#118897)

2 years agoCorrect the argument names for `secrets.choice` and `secrets.randbelow` in `secrets...
Adam Dangoor [Fri, 10 May 2024 14:30:42 +0000 (15:30 +0100)] 
Correct the argument names for `secrets.choice` and `secrets.randbelow` in `secrets.rst` (GH-118098)

Correct the argument names for `secrets.choice` and `secrets.randbelow` in `secrets.rst`.

2 years agogh-117657: Fix QSBR race condition (#118843)
Alex Turner [Fri, 10 May 2024 14:26:35 +0000 (15:26 +0100)] 
gh-117657: Fix QSBR race condition (#118843)

`_Py_qsbr_unregister` is called when the PyThreadState is already
detached, so the access to `tstate->qsbr` isn't safe without locking the
shared mutex. Grab the `struct _qsbr_shared` from the interpreter
instead.

2 years agogh-117657: Fix data races reported by TSAN on `interp->threads.main` (#118865)
mpage [Fri, 10 May 2024 13:59:14 +0000 (06:59 -0700)] 
gh-117657: Fix data races reported by TSAN on `interp->threads.main` (#118865)

Use relaxed loads/stores when reading/writing to this field.

2 years agogh-118789: Restore hidden `_PyWeakref_ClearRef` (#118797)
Sam Gross [Fri, 10 May 2024 13:54:18 +0000 (09:54 -0400)] 
gh-118789: Restore hidden `_PyWeakref_ClearRef` (#118797)

_PyWeakref_ClearRef was previously exposed in the public C-API, although
it begins with an underscore and is not documented. It's used by a few
C-API extensions. There is currently no alternative public API that can
replace its use.

_PyWeakref_ClearWeakRefsExceptCallbacks is the only thread-safe way to
use _PyWeakref_ClearRef in the free-threaded build. This exposes the C
symbol, but does not make the API public.

2 years agogh-117398: Move types to datetime state (#118606)
Victor Stinner [Fri, 10 May 2024 13:24:06 +0000 (15:24 +0200)] 
gh-117398: Move types to datetime state (#118606)

Move types to the datetime_state structure of the _datetime
extension.

2 years agoRename `notimplemented_methods` into `nodefault_methods` (#118896)
Nikita Sobolev [Fri, 10 May 2024 12:46:20 +0000 (15:46 +0300)] 
Rename `notimplemented_methods` into `nodefault_methods` (#118896)

2 years agogh-118689: Doc: fix ePub build (#118690)
Inada Naoki [Fri, 10 May 2024 10:24:02 +0000 (19:24 +0900)] 
gh-118689: Doc: fix ePub build (#118690)

2 years agogh-117873: Use positional-only parameters in _posixshmem (#118012)
Victor Stinner [Fri, 10 May 2024 10:04:16 +0000 (12:04 +0200)] 
gh-117873: Use positional-only parameters in _posixshmem (#118012)

* shm_unlink() parameter becomes positional-only.
* shm_open() first parameter (path) becomes positional-only,
  the two following parameters remain positional-or-keyword.

2 years agogh-118209: Add Windows structured exception handling to mmap module (GH-118213)
Dobatymo [Fri, 10 May 2024 09:47:30 +0000 (17:47 +0800)] 
gh-118209: Add Windows structured exception handling to mmap module (GH-118213)

2 years agoFix some missing null checks. (GH-118721)
Steve Dower [Fri, 10 May 2024 09:31:55 +0000 (10:31 +0100)] 
Fix some missing null checks. (GH-118721)

2 years agoDocs: fix typos in documentation (GH-118815)
Xie Yanbo [Fri, 10 May 2024 08:11:50 +0000 (16:11 +0800)] 
Docs: fix typos in documentation (GH-118815)

2 years agoRevert "gh-115432: Add critical section variant that handles a NULL object (#115433...
Sam Gross [Thu, 9 May 2024 22:33:53 +0000 (18:33 -0400)] 
Revert "gh-115432: Add critical section variant that handles a NULL object (#115433)" (#118861)

This reverts commit ad4f909e0e7890e027c4ae7fea74586667242ad3.

The API ended up not being used.

2 years agogh-118851: Default ctx arguments to AST constructors to Load() (#118854)
Jelle Zijlstra [Thu, 9 May 2024 22:30:14 +0000 (15:30 -0700)] 
gh-118851: Default ctx arguments to AST constructors to Load() (#118854)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-117657: Replace TSAN suppresions with more specific rules (#118722)
Brett Simmers [Thu, 9 May 2024 21:02:39 +0000 (14:02 -0700)] 
gh-117657: Replace TSAN suppresions with more specific rules (#118722)

Using `race:` filters out warnings if the function appears anywhere in
the stack trace. This can hide a lot of unrelated warnings, especially
for a function like `_PyEval_EvalFrameDefault`, which is somewhere on
the stack more often than not.

Change all free-threaded suppressions to `race_top:`, which only matches
the top frame, and add any new suppressions this exposes.

2 years agogh-118846: Fix PGO tests in free-threaded build (#118862)
Sam Gross [Thu, 9 May 2024 20:06:20 +0000 (16:06 -0400)] 
gh-118846: Fix PGO tests in free-threaded build (#118862)

Avoid immortalizing objects in tests that verify garbage collection of
classes or modules.

This fixes test_ordered_dict and test_struct.

2 years agogh-116984: Make mimalloc header includes relative to the current file (#118808)
Sam Gross [Thu, 9 May 2024 20:03:45 +0000 (16:03 -0400)] 
gh-116984: Make mimalloc header includes relative to the current file (#118808)

Some embedders and extensions include parts of the internal API. The
pycore_mimalloc.h file is transitively include by a number of other
internal headers. This avoids include errors for code that was
already including those headers.

2 years agogh-118561: Fix crash involving list.extend in free-threaded build (#118723)
Sam Gross [Thu, 9 May 2024 18:52:27 +0000 (14:52 -0400)] 
gh-118561: Fix crash involving list.extend in free-threaded build (#118723)

The `list_preallocate_exact` function did not zero initialize array
contents. In the free-threaded build, this could expose uninitialized
memory to concurrent readers between the call to
`list_preallocate_exact` and the filling of the array contents with
items.

2 years agogh-118849: Fix "code will never be executed" warning in `dictobject.c` (#118850)
Nikita Sobolev [Thu, 9 May 2024 17:15:14 +0000 (20:15 +0300)] 
gh-118849: Fix "code will never be executed" warning in `dictobject.c` (#118850)

2 years agogh-118773: Use language-invariant SDDL string instead of aliases for ACLs. (GH-118800)
Steve Dower [Thu, 9 May 2024 16:43:21 +0000 (17:43 +0100)] 
gh-118773: Use language-invariant SDDL string instead of aliases for ACLs. (GH-118800)

2 years agogh-117657: Acquire a critical section around `SemLock.__{enter,exit}__` (#118812)
mpage [Thu, 9 May 2024 16:05:52 +0000 (09:05 -0700)] 
gh-117657: Acquire a critical section around `SemLock.__{enter,exit}__` (#118812)

These methods are purely wrappers around `Semlock.{acquire,release}`,
which expect a critical section to be held.

2 years agogh-118817: Fix `asyncio REPL` on Windows (#118819)
Kirill Podoprigora [Thu, 9 May 2024 15:20:46 +0000 (18:20 +0300)] 
gh-118817: Fix `asyncio REPL` on Windows (#118819)

2 years agogh-118767: Improve tests and docs for bool(NotImplemented) (#118813) 118842/head
Jelle Zijlstra [Thu, 9 May 2024 13:52:08 +0000 (06:52 -0700)] 
gh-118767: Improve tests and docs for bool(NotImplemented) (#118813)

2 years agogh-118802: Fix ACL use in test for non-English Windows (GH-118831)
Steve Dower [Thu, 9 May 2024 12:59:18 +0000 (13:59 +0100)] 
gh-118802: Fix ACL use in test for non-English Windows (GH-118831)

2 years agogh-103956: Fix `trace` output in case of missing source line (GH-103958)
Radislav Chugunov [Thu, 9 May 2024 12:09:44 +0000 (15:09 +0300)] 
gh-103956: Fix `trace` output in case of missing source line (GH-103958)

Print only filename with lineno if linecache.getline() returns an empty string.

2 years agogh-118805: Remove type, choices, metavar params of `BooleanOptionalAction` (#118806)
Nikita Sobolev [Thu, 9 May 2024 11:46:45 +0000 (14:46 +0300)] 
gh-118805: Remove type, choices, metavar params of `BooleanOptionalAction` (#118806)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-118798: Remove deprecated isdst parameter from `email.utils.localtime` (#118799)
Hugo van Kemenade [Thu, 9 May 2024 09:17:02 +0000 (12:17 +0300)] 
gh-118798: Remove deprecated isdst parameter from `email.utils.localtime` (#118799)

2 years agogh-118033: Fix `__weakref__` not set for generic dataclasses (#118099)
Nikita Sobolev [Thu, 9 May 2024 08:36:17 +0000 (11:36 +0300)] 
gh-118033: Fix `__weakref__` not set for generic dataclasses (#118099)

2 years agoGH-101588: Remove deprecated pickle/copy/deepcopy from itertools (gh-118816)
Raymond Hettinger [Thu, 9 May 2024 08:31:47 +0000 (03:31 -0500)] 
GH-101588: Remove deprecated pickle/copy/deepcopy from itertools (gh-118816)

2 years ago[tests]: Mark ``test_statistics.test_kde_random`` with a ``requires_resource('cpu...
Kirill Podoprigora [Thu, 9 May 2024 08:16:37 +0000 (11:16 +0300)] 
[tests]: Mark ``test_statistics.test_kde_random`` with a ``requires_resource('cpu')`` decorator (#118801)

Mark test_kde_random with a requires_resource('cpu') decorator

2 years agogh-118803: Remove `ByteString` from `typing` and `collections.abc` (#118804)
Nikita Sobolev [Wed, 8 May 2024 23:37:55 +0000 (02:37 +0300)] 
gh-118803: Remove `ByteString` from `typing` and `collections.abc` (#118804)

2 years agogh-117657: Fix data races when writing / reading `ob_gc_bits` (#118292)
mpage [Wed, 8 May 2024 20:03:39 +0000 (13:03 -0700)] 
gh-117657: Fix data races when writing / reading `ob_gc_bits` (#118292)

Use relaxed atomics when reading / writing to the field. There are still a
few places in the GC where we do not use atomics. Those should be safe as
the world is stopped.

2 years agoFixing a typo in test_cmd_line.py (#118728)
Yutian Li [Wed, 8 May 2024 19:58:48 +0000 (15:58 -0400)] 
Fixing a typo in test_cmd_line.py (#118728)

2 years agoFormat None, True, False and NotImplemented as literals (GH-118758)
Serhiy Storchaka [Wed, 8 May 2024 19:35:16 +0000 (22:35 +0300)] 
Format None, True, False and NotImplemented as literals (GH-118758)

2 years agodocs: module page titles should not start with a link to themselves (#117099)
Ned Batchelder [Wed, 8 May 2024 19:34:40 +0000 (15:34 -0400)] 
docs: module page titles should not start with a link to themselves (#117099)

2 years agoDocs: fix typos in documentation (#118752)
Xie Yanbo [Wed, 8 May 2024 18:20:40 +0000 (02:20 +0800)] 
Docs: fix typos in documentation (#118752)

2 years agoRun CI on the 3.13 branch (#118779)
Jelle Zijlstra [Wed, 8 May 2024 18:12:36 +0000 (11:12 -0700)] 
Run CI on the 3.13 branch (#118779)

2 years agogh-118767: Make bool(NotImplemented) raise TypeError (#118775)
Jelle Zijlstra [Wed, 8 May 2024 18:12:00 +0000 (11:12 -0700)] 
gh-118767: Make bool(NotImplemented) raise TypeError (#118775)

2 years agogh-118772: Allow TypeVars without a default to follow those with a default when const...
Jelle Zijlstra [Wed, 8 May 2024 16:54:51 +0000 (09:54 -0700)] 
gh-118772: Allow TypeVars without a default to follow those with a default when constructing aliases (#118774)

2 years agoFix file extensions for 3.14 Whats New (#118770)
Jelle Zijlstra [Wed, 8 May 2024 16:40:40 +0000 (09:40 -0700)] 
Fix file extensions for 3.14 Whats New (#118770)