]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
14 months agogh-122981: Fix inspect.getsource() for generated classes with Python base classes... 123156/head
Serhiy Storchaka [Tue, 20 Aug 2024 17:10:15 +0000 (20:10 +0300)] 
gh-122981: Fix inspect.getsource() for generated classes with Python base classes (GH-123001)

Look up __firstlineno__ only in the class' dict, without searching in
base classes.

14 months agoGH-118093: Make `CALL_ALLOC_AND_ENTER_INIT` suitable for tier 2. (GH-123140)
Mark Shannon [Tue, 20 Aug 2024 15:52:58 +0000 (16:52 +0100)] 
GH-118093: Make `CALL_ALLOC_AND_ENTER_INIT` suitable for tier 2. (GH-123140)

* Convert CALL_ALLOC_AND_ENTER_INIT to micro-ops such that tier 2 supports it

* Allow inexact arguments for CALL_ALLOC_AND_ENTER_INIT.

14 months agogh-123048: Fix missing source location in pattern matching code (#123167)
Irit Katriel [Tue, 20 Aug 2024 10:39:41 +0000 (11:39 +0100)] 
gh-123048: Fix missing source location in pattern matching code (#123167)

14 months agogh-122909: Pass ftp error strings to URLError constructor (#122913)
Jeremy Hylton [Tue, 20 Aug 2024 00:35:05 +0000 (20:35 -0400)] 
gh-122909: Pass ftp error strings to URLError constructor (#122913)

* pass the original string error message from the ftplib error to URLError()

* Update request.py

Change error string for ftp error to be consistent with other errors reported for ftp

* Add NEWS entry for change to urllib.request for ftp errors.

* Track the change in the ftp error message in the test.

14 months agogh-109975: Copyedit What's New in Python 3.13 (#123150)
Jelle Zijlstra [Mon, 19 Aug 2024 23:51:37 +0000 (16:51 -0700)] 
gh-109975: Copyedit What's New in Python 3.13 (#123150)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
14 months agogh-123149: Suppress verbose repr in new REPL (#123151)
James [Mon, 19 Aug 2024 19:04:38 +0000 (15:04 -0400)] 
gh-123149: Suppress verbose repr in new REPL (#123151)

14 months agogh-123123: Fix display of syntax errors covering multiple lines (#123131)
Pablo Galindo Salgado [Mon, 19 Aug 2024 15:09:03 +0000 (17:09 +0200)] 
gh-123123: Fix display of syntax errors covering multiple lines (#123131)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
14 months agogh-121404: rename functions to use codegen_* prefix. Use macros more consistently...
Irit Katriel [Mon, 19 Aug 2024 14:39:53 +0000 (15:39 +0100)] 
gh-121404: rename functions to use codegen_* prefix. Use macros more consistently. (#123139)

14 months agogh-121804: Always show error location for SyntaxError's in new repl (#121886)
Sergey B Kirpichev [Mon, 19 Aug 2024 14:19:23 +0000 (17:19 +0300)] 
gh-121804: Always show error location for SyntaxError's in new repl (#121886)

14 months agogh-121404: pass metadata to compiler_enter_scope (optionally) so that codegen functio...
Irit Katriel [Mon, 19 Aug 2024 10:49:42 +0000 (11:49 +0100)] 
gh-121404: pass metadata to compiler_enter_scope (optionally) so that codegen functions don't need to set it on the code unit (#123078)

14 months agogh-122081: fixed crash in decimal.IEEEContext() (#122082)
Sergey B Kirpichev [Mon, 19 Aug 2024 07:51:38 +0000 (10:51 +0300)] 
gh-122081: fixed crash in decimal.IEEEContext() (#122082)

* gh-122081: fixed crash in decimal.IEEEContext()

Now

$ ./configure CFLAGS=-DEXTRA_FUNCTIONALITY -q && make -s && \
     ./python -m test test_decimal

- PASS

* Apply suggestions from code review

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Update Misc/NEWS.d/next/Library/2024-07-21-10-45-24.gh-issue-122081.dNrYMq.rst

* Apply suggestions from code review

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
14 months agogh-123049: configparser: Allow to create the unnamed section from scratch. (#123077)
Pedro Lacerda [Sun, 18 Aug 2024 19:52:25 +0000 (16:52 -0300)] 
gh-123049: configparser: Allow to create the unnamed section from scratch. (#123077)

---------

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
14 months agogh-116789: Add more tests for `inspect.getmembers` (#116802)
sobolevn [Sun, 18 Aug 2024 15:42:56 +0000 (18:42 +0300)] 
gh-116789: Add more tests for `inspect.getmembers` (#116802)

14 months agogh-123110: correct note about _Bool in the struct module docs (GH-123111)
Sergey B Kirpichev [Sun, 18 Aug 2024 13:58:58 +0000 (16:58 +0300)] 
gh-123110: correct note about _Bool in the struct module docs (GH-123111)

14 months agogh-82378 fix sys.tracebacklimit in pyrepl, approach 2 (#123062)
CF Bolz-Tereick [Sun, 18 Aug 2024 11:28:23 +0000 (13:28 +0200)] 
gh-82378 fix sys.tracebacklimit in pyrepl, approach 2 (#123062)

Make sure that pyrepl uses the same logic for sys.tracebacklimit as both
the basic repl and the standard sys.excepthook

14 months agoDocs: Run ``latexmk`` in parallel when creating PDFs (#123113)
Adam Turner [Sat, 17 Aug 2024 20:58:06 +0000 (21:58 +0100)] 
Docs: Run ``latexmk`` in parallel when creating PDFs (#123113)

14 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.

14 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.

14 months 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.

14 months 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>
14 months 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>
14 months agofix typo in dis.rst (#121612)
mathysEthical [Sat, 17 Aug 2024 08:50:58 +0000 (10:50 +0200)] 
fix typo in dis.rst (#121612)

14 months 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)

14 months 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)

14 months 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)

14 months 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

14 months 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
```

14 months 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>
14 months 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)

14 months 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)

14 months 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)

14 months 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>
14 months 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.

14 months 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)

14 months 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)

14 months 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)

14 months 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>
14 months 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)

14 months 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)

14 months 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)

14 months 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

14 months 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>
14 months 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)

14 months 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>
14 months 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)

14 months 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)

14 months 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)

14 months 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)

14 months 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

14 months 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)

14 months 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`.

14 months 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)

14 months 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.

14 months 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.

14 months 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)

14 months 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`.

14 months 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.

14 months 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.

14 months 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)

14 months 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>
14 months 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>
14 months 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)

14 months 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)

14 months 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)

14 months 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)

14 months 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.

14 months 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>
14 months 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>
14 months 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.

14 months 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)

14 months 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

14 months 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)

14 months 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)

14 months 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)

14 months 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)

14 months 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)

14 months 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.

14 months 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)

14 months 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.

14 months 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>
14 months 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>
14 months 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)

14 months 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)

14 months 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>
14 months 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.

14 months 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>
14 months 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)

14 months 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>
14 months 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

14 months 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>
14 months 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)

14 months 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.

14 months 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.

15 months 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.)

15 months 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>
15 months 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>
15 months 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)

15 months 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.

15 months 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)

15 months 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