]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
23 months agogh-123022: Fix crash with `Py_Initialize` in background thread (#123052)
Sam Gross [Sat, 17 Aug 2024 20:04:08 +0000 (16:04 -0400)] 
gh-123022: Fix crash with  `Py_Initialize` in background thread (#123052)

Check that the current default heap is initialized in
`_mi_os_get_aligned_hint` and `mi_os_claim_huge_pages`.

The mimalloc function `_mi_os_get_aligned_hint` assumes that there is an
initialized default heap. This is true for our main thread, but not for
background threads. The problematic code path is usually called during
initialization (i.e., `Py_Initialize`), but it may also be called if the
program allocates large amounts of memory in total.

The crash only affected the free-threaded build.

23 months agogh-122974: Suppress GCC array bound warnings in free-threaded build (#123071)
Sam Gross [Sat, 17 Aug 2024 20:03:50 +0000 (16:03 -0400)] 
gh-122974: Suppress GCC array bound warnings in free-threaded build (#123071)

GCC 11 and newer warn about the access to `unique_id` in non-debug builds
due to inlining the call on static non-heap types.

2 years agogh-123067: Fix quadratic complexity in parsing "-quoted cookie values with backslashe...
Serhiy Storchaka [Sat, 17 Aug 2024 13:30:52 +0000 (16:30 +0300)] 
gh-123067: Fix quadratic complexity in parsing "-quoted cookie values with backslashes (GH-123075)

This fixes CVE-2024-7592.

2 years agoGH-109975: Copyedit 3.13 What's New: Other Language Changes (#123086)
Adam Turner [Sat, 17 Aug 2024 12:09:42 +0000 (13:09 +0100)] 
GH-109975: Copyedit 3.13 What's New: Other Language Changes (#123086)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 years agogh-121477: mention new PyLong_*Bytes() functions in PyLong_FromString() (#121478)
Sergey B Kirpichev [Sat, 17 Aug 2024 09:13:31 +0000 (12:13 +0300)] 
gh-121477: mention new PyLong_*Bytes() functions in PyLong_FromString() (#121478)

* gh-121477: mention new PyLong_*Bytes() functions in PyLong_FromString()

* Update Doc/c-api/long.rst

---------

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2 years agofix typo in dis.rst (#121612)
mathysEthical [Sat, 17 Aug 2024 08:50:58 +0000 (10:50 +0200)] 
fix typo in dis.rst (#121612)

2 years agoRemove unneeded verb in the phrase in sys.rst (#122718)
Rafael Fontenelle [Sat, 17 Aug 2024 08:48:31 +0000 (05:48 -0300)] 
Remove unneeded verb in the phrase in sys.rst (#122718)

2 years agogh-122519: Adding socket module shutdown() constants description (#122543)
Damien [Sat, 17 Aug 2024 08:29:23 +0000 (16:29 +0800)] 
gh-122519: Adding socket module shutdown() constants description (#122543)

2 years agogh-122681: remove m_atan2()/c_atan2() helpers (#122715)
Sergey B Kirpichev [Sat, 17 Aug 2024 08:18:16 +0000 (11:18 +0300)] 
gh-122681: remove m_atan2()/c_atan2() helpers (#122715)

2 years agogh-123087: ``Lib/test/test_unittest/testmock/testasync.py``: Replace usage of the...
Kirill Podoprigora [Sat, 17 Aug 2024 08:03:51 +0000 (11:03 +0300)] 
gh-123087: ``Lib/test/test_unittest/testmock/testasync.py``: Replace usage of the deprecated ``asyncio.iscoroutinefunction`` with the ``inspect.iscoroutinefunction`` (#123088)

asyncio.iscoroutinefunction -> inspect.iscoroutinefunction

2 years agoGH-120754: Disable buffering in Path.read_bytes (#122111)
Cody Maloney [Fri, 16 Aug 2024 20:52:41 +0000 (13:52 -0700)] 
GH-120754: Disable buffering in Path.read_bytes (#122111)

`Path.read_bytes()` is used to read a whole file. buffering /
BufferedIO is focused around making small, possibly interleaved,
read/write efficient which doesn't add value in this case.

On my Mac, running the benchmark:

```python
import pyperf
from pathlib import Path

def read_all(all_paths):
    for p in all_paths:
        p.read_bytes()

def read_file(path_obj):
    path_obj.read_bytes()

all_rst = list(Path("Doc").glob("**/*.rst"))
all_py = list(Path(".").glob("**/*.py"))
assert all_rst, "Should have found rst files"
assert all_py, "Should have found python source files"

runner = pyperf.Runner()
runner.bench_func("read_file_small", read_file, Path("Doc/howto/clinic.rst"))
runner.bench_func("read_file_large", read_file, Path("Doc/c-api/typeobj.rst"))
```

before:
```python
.....................
read_file_small: Mean +- std dev: 6.80 us +- 0.07 us
.....................
read_file_large: Mean +- std dev: 10.8 us +- 0.2 us
````

after:
```python
.....................
read_file_small: Mean +- std dev: 5.67 us +- 0.05 us
.....................
read_file_large: Mean +- std dev: 9.77 us +- 0.52 us
```

2 years agogh-118658: Return consistent types from `get_un/verified_chain` in `SSLObject` and...
Mateusz Nowak [Fri, 16 Aug 2024 20:27:44 +0000 (22:27 +0200)] 
gh-118658: Return consistent types from `get_un/verified_chain` in `SSLObject` and `SSLSocket` (#118669)

Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
2 years agoGH-118093: Specialize `CALL_KW` (GH-123006)
Mark Shannon [Fri, 16 Aug 2024 16:11:24 +0000 (17:11 +0100)] 
GH-118093: Specialize `CALL_KW` (GH-123006)

2 years agogh-121404: rename compiler_addop* to codegen_addop*, and replace direct usages by...
Irit Katriel [Fri, 16 Aug 2024 14:57:32 +0000 (15:57 +0100)] 
gh-121404: rename compiler_addop* to codegen_addop*, and replace direct usages by the macros (#123043)

2 years agomention pypy somewhat more prominently in the pyrepl section of whatsnew (#123063)
CF Bolz-Tereick [Fri, 16 Aug 2024 11:38:44 +0000 (13:38 +0200)] 
mention pypy somewhat more prominently in the pyrepl section of whatsnew (#123063)

2 years agogh-123046: Fix regexp to catch cases where the module name is omitted from the weakre...
Kirill Podoprigora [Fri, 16 Aug 2024 07:14:53 +0000 (10:14 +0300)] 
gh-123046: Fix regexp to catch cases where the module name is omitted from the weakref repr (#123047)

Co-authored-by: sobolevn <mail@sobolevn.me>
2 years agogh-116622: Add Android test script (#121595)
Malcolm Smith [Fri, 16 Aug 2024 05:00:29 +0000 (06:00 +0100)] 
gh-116622: Add Android test script (#121595)

Adds a script for running the test suite on Android emulator devices. Starting
with a fresh install of the Android Commandline tools; the script manages
installing other requirements, starting the emulator (if required), and
retrieving results from that emulator.

2 years agogh-116608: Apply style and compatibility changes from importlib_metadata. (#123028)
Jason R. Coombs [Thu, 15 Aug 2024 19:32:05 +0000 (15:32 -0400)] 
gh-116608: Apply style and compatibility changes from importlib_metadata. (#123028)

2 years agoAdd debug offsets for free threaded builds (#123041)
Pablo Galindo Salgado [Thu, 15 Aug 2024 18:42:41 +0000 (19:42 +0100)] 
Add debug offsets for free threaded builds (#123041)

2 years agoGH-121634: have `wasi.py` accept the host target triple as an argument (GH-123030)
Brett Cannon [Thu, 15 Aug 2024 17:30:08 +0000 (10:30 -0700)] 
GH-121634: have `wasi.py` accept the host target triple as an argument (GH-123030)

2 years agogh-117139: Garbage collector support for deferred refcounting (#122956)
Sam Gross [Thu, 15 Aug 2024 16:09:11 +0000 (12:09 -0400)] 
gh-117139: Garbage collector support for deferred refcounting (#122956)

The free-threaded GC now visits interpreter stacks to keep objects
that use deferred reference counting alive.

Interpreter frames are zero initialized in the free-threaded GC so
that the GC doesn't see garbage data. This is a temporary measure
until stack spilling around escaping calls is implemented.

Co-authored-by: Ken Jin <kenjin@python.org>
2 years agogh-122584: Import mimalloc headers in a C++ context (#122587)
Michael Droettboom [Thu, 15 Aug 2024 13:01:01 +0000 (09:01 -0400)] 
gh-122584: Import mimalloc headers in a C++ context (#122587)

2 years agogh-113190: Reenable non-debug interned string cleanup (GH-113601)
Eddie Elizondo [Thu, 15 Aug 2024 11:55:09 +0000 (07:55 -0400)] 
gh-113190: Reenable non-debug interned string cleanup (GH-113601)

2 years agogh-121404: split compiler's push/pop_inlined_comprehension_state into codegen and...
Irit Katriel [Thu, 15 Aug 2024 11:08:54 +0000 (12:08 +0100)] 
gh-121404: split compiler's push/pop_inlined_comprehension_state into codegen and compiler parts (#123021)

2 years agogh-99108: Inform HACL when explicit_bzero is unavailable (GH-123027)
Malcolm Smith [Thu, 15 Aug 2024 09:43:34 +0000 (10:43 +0100)] 
gh-99108: Inform HACL when explicit_bzero is unavailable (GH-123027)

Inform HACL whether explicit_bzero is available

2 years agoGH-109975: Copyedit 3.13 What's New: New Features (#122990)
Adam Turner [Thu, 15 Aug 2024 09:08:15 +0000 (10:08 +0100)] 
GH-109975: Copyedit 3.13 What's New: New Features (#122990)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2 years agoGH-103484: Tell linkcheck to ignore debian manpage redirects (#123019)
Rafael Fontenelle [Wed, 14 Aug 2024 21:35:23 +0000 (18:35 -0300)] 
GH-103484: Tell linkcheck to ignore debian manpage redirects (#123019)

2 years agogh-112301: Add warning count to warning check tooling (#122711)
Nate Ohlson [Wed, 14 Aug 2024 21:03:53 +0000 (16:03 -0500)] 
gh-112301: Add warning count to warning check tooling (#122711)

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>
2 years agogh-123005: Add version added in enum.Flag.__len__ (GH-123007)
Damien [Wed, 14 Aug 2024 20:30:33 +0000 (04:30 +0800)] 
gh-123005: Add version added in enum.Flag.__len__ (GH-123007)

2 years agoGH-118093: Turn some DEOPT_IFs into EXIT_IFs (GH-122998)
Brandt Bucher [Wed, 14 Aug 2024 14:54:42 +0000 (07:54 -0700)] 
GH-118093: Turn some DEOPT_IFs into EXIT_IFs (GH-122998)

2 years agoGH-113464: Speed up JIT builds (GH-122839)
Brandt Bucher [Wed, 14 Aug 2024 14:53:46 +0000 (07:53 -0700)] 
GH-113464: Speed up JIT builds (GH-122839)

2 years agogh-122965: Fix `reusable-change-detection.yml` on `workflow_dispatch` (#122966)
sobolevn [Wed, 14 Aug 2024 12:05:39 +0000 (15:05 +0300)] 
gh-122965: Fix `reusable-change-detection.yml` on `workflow_dispatch` (#122966)

2 years agoGH-120024: Remove `CHECK_EVAL_BREAKER` macro. (GH-122968)
Mark Shannon [Wed, 14 Aug 2024 11:04:05 +0000 (12:04 +0100)] 
GH-120024: Remove `CHECK_EVAL_BREAKER` macro. (GH-122968)

* Factor some instructions into micro-ops to isolate CHECK_EVAL_BREAKER for escape analysis

* Eliminate CHECK_EVAL_BREAKER macro

2 years agoFix doctrees directory for the gettext builder (#122997)
Rafael Fontenelle [Wed, 14 Aug 2024 10:38:29 +0000 (07:38 -0300)] 
Fix doctrees directory for the gettext builder (#122997)

2 years ago gh-111178: Avoid calling long_hash from incompatible pointer type (GH-122972)
Bénédikt Tran [Wed, 14 Aug 2024 09:50:35 +0000 (11:50 +0200)] 
 gh-111178: Avoid calling long_hash from incompatible pointer type (GH-122972)

Make `long_hash` compatible with `hashfunc`.

2 years agogh-122985: add SYMBOL_TO_SCOPE macro in symtable (#122986)
Irit Katriel [Wed, 14 Aug 2024 05:17:04 +0000 (06:17 +0100)] 
gh-122985: add SYMBOL_TO_SCOPE macro in symtable (#122986)

2 years agoEnsure that iOS test re-runs don't try to spawn a process. (#122994)
Russell Keith-Magee [Wed, 14 Aug 2024 01:46:53 +0000 (09:46 +0800)] 
Ensure that iOS test re-runs don't try to spawn a process. (#122994)

Adds the --single-process option to the iOS test runner to ensure re-runs execute in the same process.

2 years agoAdd a --rerun option to the iOS testbed. (#122992)
Russell Keith-Magee [Wed, 14 Aug 2024 00:14:33 +0000 (08:14 +0800)] 
Add a --rerun option to the iOS testbed. (#122992)

Enable --rerun when running tests on iOS.

2 years agoGH-121723: Skip test_config_queue_handler_multiprocessing_context in emulated JIT...
Bénédikt Tran [Tue, 13 Aug 2024 23:25:36 +0000 (01:25 +0200)] 
GH-121723: Skip test_config_queue_handler_multiprocessing_context in emulated JIT CI (#122969)

2 years agogh-99108: Add HACL* Blake2 implementation to hashlib (GH-119316)
Jonathan Protzenko [Tue, 13 Aug 2024 21:42:19 +0000 (14:42 -0700)] 
gh-99108: Add HACL* Blake2 implementation to hashlib (GH-119316)

This replaces the existing hashlib Blake2 module with a single implementation that uses HACL\*'s Blake2b/Blake2s implementations. We added support for all the modes exposed by the Python API, including tree hashing, leaf nodes, and so on. We ported and merged all of these changes upstream in HACL\*, added test vectors based on Python's existing implementation, and exposed everything needed for hashlib.

This was joint work done with @R1kM.

See the PR for much discussion and benchmarking details.   TL;DR: On many systems, 8-50% faster (!) than `libb2`, on some systems it appeared 10-20% slower than `libb2`.

2 years agogh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set (gh-122952)
Eric Snow [Tue, 13 Aug 2024 20:44:57 +0000 (14:44 -0600)] 
gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set (gh-122952)

As of 529a160 (gh-118204), building with HAVE_DYNAMIC_LOADING stopped working.  This is a minimal fix just to get builds working again.  There are actually a number of long-standing deficiencies with HAVE_DYNAMIC_LOADING builds that need to be resolved separately.

2 years agoGH-85633: Fix pathlib test failures on filesystems without world-write. (#122883)
Barney Gale [Tue, 13 Aug 2024 17:09:21 +0000 (18:09 +0100)] 
GH-85633: Fix pathlib test failures on filesystems without world-write. (#122883)

Replace `umask(0)` with `umask(0o002)` so the created files are not
world-writable, and replace `umask(0o022)` with `umask(0o026)` to check
that permissions for 'others' can still be set.

2 years agoFix `print` usage in `turtle` doctests (#122940)
sobolevn [Tue, 13 Aug 2024 16:39:12 +0000 (19:39 +0300)] 
Fix `print` usage in `turtle` doctests (#122940)

2 years agogh-122873: Allow "python -m json" to work (#122884)
Trey Hunner [Tue, 13 Aug 2024 16:09:38 +0000 (09:09 -0700)] 
gh-122873: Allow "python -m json" to work (#122884)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2 years agoGH-109975: Copyedit 3.13 What's New: Release Highlights (#122958)
Adam Turner [Tue, 13 Aug 2024 14:30:59 +0000 (15:30 +0100)] 
GH-109975: Copyedit 3.13 What's New: Release Highlights (#122958)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 years agoGH-122390: Replace `_Py_GetbaseOpcode` with `_Py_GetBaseCodeUnit` (GH-122942)
Mark Shannon [Tue, 13 Aug 2024 13:22:57 +0000 (14:22 +0100)] 
GH-122390: Replace `_Py_GetbaseOpcode` with `_Py_GetBaseCodeUnit` (GH-122942)

2 years agoGH-122821: Simplify compilation of while statements to ensure consistency of offsets...
Mark Shannon [Tue, 13 Aug 2024 09:25:44 +0000 (10:25 +0100)] 
GH-122821: Simplify compilation of while statements to ensure consistency of offsets for sys.monitoring (GH-122934)

2 years agoGH-122578: update to WASI SDK 24 (GH-122960)
Brett Cannon [Mon, 12 Aug 2024 23:21:00 +0000 (16:21 -0700)] 
GH-122578: update to WASI SDK 24 (GH-122960)

2 years agoGH-118093: Handle some polymorphism before requiring progress in tier two (GH-122843)
Brandt Bucher [Mon, 12 Aug 2024 19:39:31 +0000 (12:39 -0700)] 
GH-118093: Handle some polymorphism before requiring progress in tier two (GH-122843)

2 years agogh-117482: Make the Slot Wrapper Inheritance Tests Much More Thorough (gh-122867)
Eric Snow [Mon, 12 Aug 2024 19:19:33 +0000 (13:19 -0600)] 
gh-117482: Make the Slot Wrapper Inheritance Tests Much More Thorough (gh-122867)

There were a still a number of gaps in the tests, including not looking
at all the builtin types and not checking wrappers in subinterpreters
that weren't in the main interpreter. This fixes all that.

I considered incorporating the names of the PyTypeObject fields
(a la gh-122866), but figured doing so doesn't add much value.

2 years agogh-117139: Replace _PyList_FromArraySteal with stack ref variant (#122830)
Sam Gross [Mon, 12 Aug 2024 18:49:49 +0000 (14:49 -0400)] 
gh-117139: Replace _PyList_FromArraySteal with stack ref variant (#122830)

This replaces `_PyList_FromArraySteal` with `_PyList_FromStackRefSteal`.
It's functionally equivalent, but takes a `_PyStackRef` array instead of
an array of `PyObject` pointers.

Co-authored-by: Ken Jin <kenjin@python.org>
2 years agogh-117139: Fix a few `_PyStackRef` related bugs (#122831)
Sam Gross [Mon, 12 Aug 2024 18:49:33 +0000 (14:49 -0400)] 
gh-117139: Fix a few `_PyStackRef` related bugs (#122831)

`BUILD_SET` should use a borrow instead of a steal. The cleanup in `_DO_CALL`
`CONVERSION_FAILED` was incorrect.

Co-authored-by: Ken Jin <kenjin@python.org>
2 years agogh-122944: Fix incorrect prompt strings in the Python Tutorial (#122949)
Damien [Mon, 12 Aug 2024 18:30:08 +0000 (02:30 +0800)] 
gh-122944: Fix incorrect prompt strings in the Python Tutorial (#122949)

In the REPL, top level comments are followed by a primary, not secondary prompt.
Fix the places in the in the tutorial that use the latter.

2 years agoGH-122869: Add missing tier two optimizer cases (GH-122936)
Mark Shannon [Mon, 12 Aug 2024 17:35:52 +0000 (18:35 +0100)] 
GH-122869: Add missing tier two optimizer cases (GH-122936)

2 years agogh-122888: Fix crash on certain calls to str() (#122889)
Jelle Zijlstra [Mon, 12 Aug 2024 16:20:09 +0000 (09:20 -0700)] 
gh-122888: Fix crash on certain calls to str() (#122889)

Fixes #122888

2 years agoFix old-style `print` statement in `gettext` comments (#122939)
sobolevn [Mon, 12 Aug 2024 15:15:57 +0000 (18:15 +0300)] 
Fix old-style `print` statement in `gettext` comments (#122939)

2 years agogh-122688: Add more tests for var-positional parameters in Argument Clinic (GH-122900)
Serhiy Storchaka [Mon, 12 Aug 2024 13:52:48 +0000 (16:52 +0300)] 
gh-122688: Add more tests for var-positional parameters in Argument Clinic (GH-122900)

2 years agoFix typos in comments and test code (#122846) 121739/head
Xie Yanbo [Mon, 12 Aug 2024 04:16:41 +0000 (12:16 +0800)] 
Fix typos in comments and test code (#122846)

2 years agoRemove "print >>obj" exception hint for Python 2 (#122853)
Victor Stinner [Mon, 12 Aug 2024 04:12:14 +0000 (06:12 +0200)] 
Remove "print >>obj" exception hint for Python 2 (#122853)

2 years agogh-122903: Honor directories in zipfile.Path.glob. (#122908)
Jason R. Coombs [Mon, 12 Aug 2024 00:33:33 +0000 (20:33 -0400)] 
gh-122903: Honor directories in zipfile.Path.glob. (#122908)

2 years agogh-122905: Sanitize names in zipfile.Path. (#122906)
Jason R. Coombs [Sun, 11 Aug 2024 23:48:50 +0000 (19:48 -0400)] 
gh-122905: Sanitize names in zipfile.Path. (#122906)

Ported from zipp 3.19.1; ref jaraco/zipp#119.

2 years agogh-119180: annotationlib: Fix __all__, formatting (#122365)
Jelle Zijlstra [Sun, 11 Aug 2024 23:44:51 +0000 (16:44 -0700)] 
gh-119180: annotationlib: Fix __all__, formatting (#122365)

2 years agogh-119180: Improvements to ForwardRef.evaluate (#122210)
Jelle Zijlstra [Sun, 11 Aug 2024 23:42:57 +0000 (16:42 -0700)] 
gh-119180: Improvements to ForwardRef.evaluate (#122210)

Noticed some issues while writing documentation for this method.

2 years agoGH-73991: Rework `pathlib.Path.copytree()` into `copy()` (#122369)
Barney Gale [Sun, 11 Aug 2024 21:43:18 +0000 (22:43 +0100)] 
GH-73991: Rework `pathlib.Path.copytree()` into `copy()` (#122369)

Rename `pathlib.Path.copy()` to `_copy_file()` (i.e. make it private.)

Rename `pathlib.Path.copytree()` to `copy()`, and add support for copying
non-directories. This simplifies the interface for users, and nicely
complements the upcoming `move()` and `delete()` methods (which will also
accept any type of file.)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years agogh-122701: Fix wording of raw strings/bytes in `lexical_analysis.rst` (#122702)
sobolevn [Sun, 11 Aug 2024 21:02:50 +0000 (00:02 +0300)] 
gh-122701: Fix wording of raw strings/bytes in `lexical_analysis.rst` (#122702)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years agoDocs: Standardise versionchanged text in weakref.rst (#122898)
Rafael Fontenelle [Sun, 11 Aug 2024 20:40:11 +0000 (17:40 -0300)] 
Docs: Standardise versionchanged text in weakref.rst (#122898)

2 years agogh-122860: Remove unused macro `_Py_atomic_load_relaxed_int32` (#122861)
Sam Gross [Sun, 11 Aug 2024 17:15:02 +0000 (13:15 -0400)] 
gh-122860: Remove unused macro `_Py_atomic_load_relaxed_int32` (#122861)

2 years agogh-122858: Deprecate `asyncio.iscoroutinefunction` (#122875)
Wulian [Sun, 11 Aug 2024 16:35:51 +0000 (00:35 +0800)] 
gh-122858: Deprecate `asyncio.iscoroutinefunction` (#122875)

Deprecate `asyncio.iscoroutinefunction` in favor of `inspect.iscoroutinefunction`.

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2 years agoGH-120974: make `_asyncio.all_tasks` thread safe (#122801)
Kumar Aditya [Sun, 11 Aug 2024 15:19:31 +0000 (20:49 +0530)] 
GH-120974: make `_asyncio.all_tasks` thread safe (#122801)

Make `_asyncio.all_tasks` thread safe, also changes state lock to use critical section.

2 years agoGH-120794: Use example paths with multiple parts in pathlib docs (#122887)
Barney Gale [Sat, 10 Aug 2024 21:21:17 +0000 (22:21 +0100)] 
GH-120794: Use example paths with multiple parts in pathlib docs (#122887)

In the documentation of `PosixPath` and `WindowsPath`, and their `Pure*`
equivalents, use example paths with multiple non-anchor parts.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years agogh-122868: Add more lower bounds for sphinxcontrib dependencies (#122891)
Adam Turner [Sat, 10 Aug 2024 20:50:43 +0000 (21:50 +0100)] 
gh-122868: Add more lower bounds for sphinxcontrib dependencies (#122891)

2 years agogh-115808: Add ``is_none`` and ``is_not_none`` to ``operator`` (#115814)
Nico Mexis [Sat, 10 Aug 2024 19:16:34 +0000 (21:16 +0200)] 
gh-115808: Add ``is_none`` and ``is_not_none`` to ``operator`` (#115814)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2 years agogh-122868: Add lower bounds for sphinxcontrib dependencies (#122870)
Adam Turner [Fri, 9 Aug 2024 22:18:46 +0000 (23:18 +0100)] 
gh-122868: Add lower bounds for sphinxcontrib dependencies (#122870)

* Docs: Add lower bounds for sphinxcontrib dependencies

* oops

2 years agogh-105376: Restore deprecated logging warn() method (#122775)
Victor Stinner [Fri, 9 Aug 2024 13:13:24 +0000 (15:13 +0200)] 
gh-105376: Restore deprecated logging warn() method (#122775)

This reverts commit dcc028d92428bd57358a5028ada2a53fc79fc365 and
commit 6c54e5d72166d012b52155cbf13af9e533290e06.

Keep the deprecated logging warn() method in Python 3.13.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 years agogh-111495: Fix refleaks in test_capi.test_eval tests (#122851)
Victor Stinner [Fri, 9 Aug 2024 09:47:00 +0000 (11:47 +0200)] 
gh-111495: Fix refleaks in test_capi.test_eval tests (#122851)

2 years agogh-122688: Fix support of var-positional parameter in Argument Clinic (GH-122689)
Serhiy Storchaka [Fri, 9 Aug 2024 09:22:41 +0000 (12:22 +0300)] 
gh-122688: Fix support of var-positional parameter in Argument Clinic (GH-122689)

* Parameters after the var-positional parameter are now keyword-only
  instead of positional-or-keyword.
* Correctly calculate min_kw_only.
* Raise errors for invalid combinations of the var-positional parameter
  with "*", "/" and deprecation markers.

2 years agogh-121268: Remove workarounds for non-IEEE 754 systems in cmath (#122716)
Sergey B Kirpichev [Fri, 9 Aug 2024 09:17:40 +0000 (12:17 +0300)] 
gh-121268: Remove workarounds for non-IEEE 754 systems in cmath (#122716)

As now building Python now requires support of IEEE 754 floating point
numbers.

2 years agogh-116622: Rename build variable MODULE_LDFLAGS back to LIBPYTHON (#122764)
Malcolm Smith [Thu, 8 Aug 2024 22:00:55 +0000 (23:00 +0100)] 
gh-116622: Rename build variable MODULE_LDFLAGS back to LIBPYTHON (#122764)

(LIBPYTHON was renamed MODULE_LDFLAGS in commit 7f5e3f04f.)

2 years agoGH-118943: Remove regen-jit from the regen-all make target (GH-122602)
Miro Hrončok [Thu, 8 Aug 2024 20:34:42 +0000 (22:34 +0200)] 
GH-118943: Remove regen-jit from the regen-all make target (GH-122602)

Co-authored-by: Éric <merwok@netwok.org>
2 years agogh-112301: Update documentation for configure options (``--disable-safety`` and ...
Nate Ohlson [Thu, 8 Aug 2024 19:35:00 +0000 (14:35 -0500)] 
gh-112301: Update documentation for configure options (``--disable-safety`` and ``--enable-slower-safety``) (#122758)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years agogh-122835: Fix module name in ``test_typing`` (#122836)
Kirill Podoprigora [Thu, 8 Aug 2024 19:26:31 +0000 (22:26 +0300)] 
gh-122835: Fix module name in ``test_typing`` (#122836)

2 years agogh-122697: Fix free-threading memory leaks at shutdown (#122703)
Sam Gross [Thu, 8 Aug 2024 16:48:17 +0000 (12:48 -0400)] 
gh-122697: Fix free-threading memory leaks at shutdown (#122703)

We were not properly accounting for interpreter memory leaks at
shutdown and had two sources of leaks:

 * Objects that use deferred reference counting and were reachable via
   static types outlive the final GC. We now disable deferred reference
   counting on all objects if we are calling the GC due to interpreter
   shutdown.

 * `_PyMem_FreeDelayed` did not properly check for interpreter shutdown
   so we had some memory blocks that were enqueued to be freed, but
   never actually freed.

 * `_PyType_FinalizeIdPool` wasn't called at interpreter shutdown.

2 years agogh-122562: fix dump_symtable for ste_free and ste_child_free removal (#122825)
Irit Katriel [Thu, 8 Aug 2024 13:03:45 +0000 (14:03 +0100)] 
gh-122562: fix dump_symtable for ste_free and ste_child_free removal (#122825)

2 years agogh-111495: Add more tests on PyEval C APIs (#122789)
Victor Stinner [Thu, 8 Aug 2024 12:16:20 +0000 (14:16 +0200)] 
gh-111495: Add more tests on PyEval C APIs (#122789)

* Add Lib/test/test_capi/test_eval.py
* Add Modules/_testlimitedcapi/eval.c

2 years agoGH-120024: Tidy up case generator code a bit. (GH-122780)
Mark Shannon [Thu, 8 Aug 2024 09:57:59 +0000 (10:57 +0100)] 
GH-120024: Tidy up case generator code a bit. (GH-122780)

2 years agogh-122744: test_venv: ignore pip's complaint about missing ssl (GH-122776)
Petr Viktorin [Thu, 8 Aug 2024 09:20:58 +0000 (11:20 +0200)] 
gh-122744: test_venv: ignore pip's complaint about missing ssl (GH-122776)

2 years agoInternalDocs: Fix typo in link to instruction_sequence.c inside compiler docs (#122809)
Francisco Kurucz [Thu, 8 Aug 2024 08:19:10 +0000 (05:19 -0300)] 
InternalDocs: Fix typo in link to instruction_sequence.c inside compiler docs (#122809)

2 years agogh-122255: Add black box tests in test_warnings (GH-122227)
Serhiy Storchaka [Thu, 8 Aug 2024 07:35:47 +0000 (10:35 +0300)] 
gh-122255: Add black box tests in test_warnings (GH-122227)

They are similar to white box tests for gh-86298 in test_importlib.

2 years agogh-116263: Do not rollover empty files in RotatingFileHandler (GH-122788)
Serhiy Storchaka [Thu, 8 Aug 2024 06:48:11 +0000 (09:48 +0300)] 
gh-116263: Do not rollover empty files in RotatingFileHandler (GH-122788)

2 years agogh-120782: Update datetime test for static type immutability (#122800)
neonene [Thu, 8 Aug 2024 04:35:06 +0000 (13:35 +0900)] 
gh-120782: Update datetime test for static type immutability (#122800)

2 years agogh-122247: Move instruction instrumentation sanity check after tracing check (#122251)
Tian Gao [Thu, 8 Aug 2024 04:30:14 +0000 (21:30 -0700)] 
gh-122247: Move instruction instrumentation sanity check after tracing check (#122251)

2 years agogh-105201: Add PyIter_NextItem() (#122331)
Erlend E. Aasland [Wed, 7 Aug 2024 22:47:15 +0000 (00:47 +0200)] 
gh-105201: Add PyIter_NextItem() (#122331)

Return -1 and set an exception on error; return 0 if the iterator is
exhausted, and return 1 if the next item was fetched successfully.

Prefer this API to PyIter_Next(), which requires the caller to use
PyErr_Occurred() to differentiate between iterator exhaustion and errors.

Co-authered-by: Irit Katriel <iritkatriel@yahoo.com>
2 years agogh-118814: Fix the TypeVar constructor when name is passed by keyword (GH-122664)
Serhiy Storchaka [Wed, 7 Aug 2024 20:30:10 +0000 (23:30 +0300)] 
gh-118814: Fix the TypeVar constructor when name is passed by keyword (GH-122664)

Fix _PyArg_UnpackKeywordsWithVararg for the case when argument for
positional-or-keyword parameter is passed by keyword.
There was only one such case in the stdlib -- the TypeVar constructor.

2 years agogh-122478: Remove internal frames from tracebacks in REPL (GH-122528)
Serhiy Storchaka [Wed, 7 Aug 2024 20:20:57 +0000 (23:20 +0300)] 
gh-122478: Remove internal frames from tracebacks in REPL (GH-122528)

Frames of methods in code and codeop modules was show with non-default
sys.excepthook.

Save correct tracebacks in sys.last_traceback and update __traceback__
attribute of sys.last_value and sys.last_exc.

2 years agogh-118761: Improve import time of `pprint` (#122725)
Hugo van Kemenade [Wed, 7 Aug 2024 19:46:54 +0000 (22:46 +0300)] 
gh-118761: Improve import time of `pprint` (#122725)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years agoRemove dead code in the RE parser (GH-122796)
Serhiy Storchaka [Wed, 7 Aug 2024 19:44:18 +0000 (22:44 +0300)] 
Remove dead code in the RE parser (GH-122796)

2 years agogh-122798: Make tests for warnings in the re module more strict (GH-122799)
Serhiy Storchaka [Wed, 7 Aug 2024 19:43:49 +0000 (22:43 +0300)] 
gh-122798: Make tests for warnings in the re module more strict (GH-122799)

* Test warning messages.
* Test stack level for re.compile() and re.findall().

2 years agogh-118926: Spill deferred references to stack in cases generator (#122748)
Sam Gross [Wed, 7 Aug 2024 17:23:53 +0000 (13:23 -0400)] 
gh-118926: Spill deferred references to stack in cases generator (#122748)

This automatically spills the results from `_PyStackRef_FromPyObjectNew`
to the in-memory stack so that the deferred references are visible to
the GC before we make any possibly escaping call.

Co-authored-by: Ken Jin <kenjin@python.org>
2 years agoDocs: Change `remove` to `removes` for consistency (#121072)
smij720 [Wed, 7 Aug 2024 15:30:00 +0000 (08:30 -0700)] 
Docs: Change `remove` to `removes` for consistency (#121072)

2 years agoBump types-setuptools to 71.1.0.20240726 in /Tools (#122551)
dependabot[bot] [Wed, 7 Aug 2024 15:20:37 +0000 (16:20 +0100)] 
Bump types-setuptools to 71.1.0.20240726 in /Tools (#122551)