]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
12 months agogh-125196: Add fast-path for int in PyUnicodeWriter_WriteStr() (#125214)
Victor Stinner [Wed, 9 Oct 2024 22:01:02 +0000 (00:01 +0200)] 
gh-125196: Add fast-path for int in PyUnicodeWriter_WriteStr() (#125214)

PyUnicodeWriter_WriteStr() and PyUnicodeWriter_WriteRepr() now call
directly _PyLong_FormatWriter() if the argument is an int.

12 months agoGH-124693: Support parsing negative scientific and complex numbers argparse (GH-124823)
Savannah Ostrowski [Wed, 9 Oct 2024 21:56:50 +0000 (15:56 -0600)] 
GH-124693: Support parsing negative scientific and complex numbers argparse (GH-124823)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
12 months agogh-125196: Use PyUnicodeWriter for repr(list) (#125202)
Victor Stinner [Wed, 9 Oct 2024 21:56:30 +0000 (23:56 +0200)] 
gh-125196: Use PyUnicodeWriter for repr(list) (#125202)

Replace the private _PyUnicodeWriter with the public PyUnicodeWriter.

Replace PyObject_Repr() + _PyUnicodeWriter_WriteStr()
with PyUnicodeWriter_WriteRepr().

12 months agogh-91818: Use default program name in the CLI of many modules (GH-124867)
Serhiy Storchaka [Wed, 9 Oct 2024 21:20:53 +0000 (00:20 +0300)] 
gh-91818: Use default program name in the CLI of many modules (GH-124867)

As argparse now detects by default when the code was run as a module.

This leads to using the actual executable name instead of simply "python"
to display in the usage message ("usage: python -m ...").

12 months agoGH-121970: Extract ``availability`` into a new extension (#125082)
Adam Turner [Wed, 9 Oct 2024 20:50:03 +0000 (21:50 +0100)] 
GH-121970: Extract ``availability`` into a new extension (#125082)

12 months agogh-116510: Fix a Crash Due to Shared Immortal Interned Strings (gh-124865)
Eric Snow [Wed, 9 Oct 2024 17:32:16 +0000 (11:32 -0600)] 
gh-116510: Fix a Crash Due to Shared Immortal Interned Strings (gh-124865)

Fix a crash caused by immortal interned strings being shared between
sub-interpreters that use basic single-phase init. In that case, the string
can be used by an interpreter that outlives the interpreter that created and
interned it. For interpreters that share obmalloc state, also share the
interned dict with the main interpreter.

This is an un-revert of gh-124646 that then addresses the Py_TRACE_REFS
failures identified by gh-124785.

12 months agogh-119786: Move parser doc from devguide to InternalDocs (#125119)
Irit Katriel [Wed, 9 Oct 2024 17:21:35 +0000 (18:21 +0100)] 
gh-119786: Move parser doc from devguide to InternalDocs (#125119)

Co-authored-by: Jacob Coffee <jacob@z7x.org>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-Authored-By: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Co-Authored-By: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
Co-Authored-By: Carol Willing <carolcode@willingconsulting.com>
Co-Authored-By: Erlend E. Aasland <erlend@python.org>
Co-Authored-By: Ezio Melotti <ezio.melotti@gmail.com>
Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-Authored-By: Irit Katriel <iritkatriel@yahoo.com>
Co-Authored-By: Itamar Ostricher <itamarost@gmail.com>
Co-Authored-By: Julien Palard <julien@palard.fr>
Co-Authored-By: Mana <potpath@users.noreply.github.com>
Co-Authored-By: Muhammad Mahad <mahadpy@gmail.com>
Co-Authored-By: Ned Batchelder <ned@nedbatchelder.com>
Co-Authored-By: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-Authored-By: slateny <46876382+slateny@users.noreply.github.com>
Co-Authored-By: wookie184 <wookie1840@gmail.com>
12 months agogh-125196: Use PyUnicodeWriter in symtable.c (#125199)
Victor Stinner [Wed, 9 Oct 2024 15:54:54 +0000 (17:54 +0200)] 
gh-125196: Use PyUnicodeWriter in symtable.c (#125199)

12 months agogh-115999: Refactor `LOAD_GLOBAL` specializations to avoid reloading {globals, builti...
mpage [Wed, 9 Oct 2024 15:18:25 +0000 (08:18 -0700)] 
gh-115999: Refactor `LOAD_GLOBAL` specializations to avoid reloading {globals, builtins} keys (gh-124953)

Each of the `LOAD_GLOBAL` specializations is implemented roughly as:

1. Load keys version.
2. Load cached keys version.
3. Deopt if (1) and (2) don't match.
4. Load keys.
5. Load cached index into keys.
6. Load object from (4) at offset from (5).

This is not thread-safe in free-threaded builds; the keys object may be replaced
in between steps (3) and (4).

This change refactors the specializations to avoid reloading the keys object and
instead pass the keys object from guards to be consumed by downstream uops.

12 months agogh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_STR) (#125194)
Victor Stinner [Wed, 9 Oct 2024 15:15:23 +0000 (17:15 +0200)] 
gh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_STR) (#125194)

Replace PyUnicode_New(0, 0), PyUnicode_FromString("")
and PyUnicode_FromStringAndSize("", 0)
with Py_GetConstant(Py_CONSTANT_EMPTY_STR).

12 months agogh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_BYTES) (#125195)
Victor Stinner [Wed, 9 Oct 2024 15:12:11 +0000 (17:12 +0200)] 
gh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_BYTES) (#125195)

Replace PyBytes_FromString("") and PyBytes_FromStringAndSize("", 0)
with Py_GetConstant(Py_CONSTANT_EMPTY_BYTES).

12 months agogh-111178: Fix function signatures in codeobject.c (#125180)
Victor Stinner [Wed, 9 Oct 2024 15:02:24 +0000 (17:02 +0200)] 
gh-111178: Fix function signatures in codeobject.c (#125180)

12 months agoGH-120024: Tidy up pycore_stackref.h, splitting into GIL and free-threading sections...
Mark Shannon [Wed, 9 Oct 2024 14:43:09 +0000 (15:43 +0100)] 
GH-120024: Tidy up pycore_stackref.h, splitting into GIL and free-threading sections (GH-125095)

12 months agogh-111178: Fix function signatures in cellobject.c (#125182)
Victor Stinner [Wed, 9 Oct 2024 14:13:55 +0000 (16:13 +0200)] 
gh-111178: Fix function signatures in cellobject.c (#125182)

12 months agogh-101100: Fix Sphinx warnings in `library/unittest.mock.rst` (#124106)
Hugo van Kemenade [Wed, 9 Oct 2024 14:02:18 +0000 (17:02 +0300)] 
gh-101100: Fix Sphinx warnings in `library/unittest.mock.rst` (#124106)

12 months agogh-125168: Fix typo in `__future__.rst` (#125183)
JamesMcCarthy21 [Wed, 9 Oct 2024 13:17:18 +0000 (09:17 -0400)] 
gh-125168: Fix typo in `__future__.rst` (#125183)

* Update `__future__.rst`

Fixed typo in the sentence :pep:`649`: *Deferred evaluation of annotations using descriptors* - James McCarthy

* Update `__future__.rst`

Fixed sphinx formatting

12 months agogh-125039: Make `this_instr`/`prev_instr` const in cases generator (GH-125071)
Tomas R. [Wed, 9 Oct 2024 12:54:39 +0000 (14:54 +0200)] 
gh-125039: Make `this_instr`/`prev_instr` const in cases generator (GH-125071)

12 months agogh-101100: Consolidate documentation on `ModuleType` attributes (#124709)
Alex Waygood [Wed, 9 Oct 2024 10:53:57 +0000 (11:53 +0100)] 
gh-101100: Consolidate documentation on `ModuleType` attributes (#124709)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Barry Warsaw <barry@python.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
12 months agoFix importlib.resources issue reference in 3.13 What's New (#125175)
Alyssa Coghlan [Wed, 9 Oct 2024 10:40:50 +0000 (20:40 +1000)] 
Fix importlib.resources issue reference in 3.13 What's New (#125175)

Previous link was to the PR that removed the
mentioned importlib.resources APIs, rather than
the issue that added back their improved forms.

12 months agogh-107562: Update test certificates to expire far in the future (GH-125104)
Petr Viktorin [Wed, 9 Oct 2024 09:17:02 +0000 (11:17 +0200)] 
gh-107562: Update test certificates to expire far in the future (GH-125104)

Generated with Lib/test/certdata/make_ssl_certs.py
using openssl-3.2.2-3.fc40.x86_64 (Fedora 40).

12 months agogh-107562: make_ssl_certs.py: produce test certificates that expire far in the future...
Alexander Kanavin [Wed, 9 Oct 2024 09:16:08 +0000 (11:16 +0200)] 
gh-107562: make_ssl_certs.py: produce test certificates that expire far in the future by default (GH-107594)

This allows testing Y2038 with system time set to after that,
so that actual Y2038 issues can be exposed, and not masked
by expired certificate errors.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
12 months agogh-124969: Fix locale.nl_langinfo(locale.ALT_DIGITS) (GH-124974)
Serhiy Storchaka [Wed, 9 Oct 2024 08:42:08 +0000 (11:42 +0300)] 
gh-124969: Fix locale.nl_langinfo(locale.ALT_DIGITS) (GH-124974)

Now it returns a tuple of up to 100 strings (an empty tuple on most locales).
Previously it returned the first item of that tuple or an empty string.

12 months agogh-125150: Skip test_fma_zero_result on NetBSD due to IEE 754-2008 implementation...
Furkan Onder [Wed, 9 Oct 2024 08:40:06 +0000 (11:40 +0300)] 
gh-125150: Skip test_fma_zero_result on NetBSD due to IEE 754-2008 implementation issues (#125151)

Skip test_fma_zero_result on NetBSD due to IEE 754-2008 implementation issues

12 months agogh-124502: Remove _PyUnicode_EQ() function (#125114)
Victor Stinner [Wed, 9 Oct 2024 08:15:17 +0000 (10:15 +0200)] 
gh-124502: Remove _PyUnicode_EQ() function (#125114)

* Replace unicode_compare_eq() with unicode_eq().
* Use unicode_eq() in setobject.c.
* Replace _PyUnicode_EQ() with _PyUnicode_Equal().
* Remove unicode_compare_eq() and _PyUnicode_EQ().

12 months agodocs: in venv table use executable name (GH-124315)
musvaage [Wed, 9 Oct 2024 08:04:35 +0000 (10:04 +0200)] 
docs: in venv table use executable name (GH-124315)

Co-authored-by: musvaage <musvaage@users.noreply.github.com>
12 months agogh-101552: Allow pydoc to display signatures in source format (#124669)
Jelle Zijlstra [Wed, 9 Oct 2024 05:03:53 +0000 (22:03 -0700)] 
gh-101552: Allow pydoc to display signatures in source format (#124669)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
13 months agogh-124612: Use ghcr.io/python/autoconf instead of public image (#124657)
Donghee Na [Wed, 9 Oct 2024 00:33:18 +0000 (09:33 +0900)] 
gh-124612: Use ghcr.io/python/autoconf instead of public image (#124657)

* gh-124612: Use ghcr.io/python/autoconf instead of public image

* Update

13 months agogh-123849: Fix test_sqlite3.test_table_dump when foreign keys are enabled by default...
Mariusz Felisiak [Tue, 8 Oct 2024 22:46:11 +0000 (00:46 +0200)] 
gh-123849: Fix test_sqlite3.test_table_dump when foreign keys are enabled by default (#123859)

13 months agoGH-124478: Cleanup argparse documentation (#124877)
Savannah Ostrowski [Tue, 8 Oct 2024 22:07:29 +0000 (15:07 -0700)] 
GH-124478: Cleanup argparse documentation (#124877)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Tomas R <tomas.roun8@gmail.com>
13 months agogh-116110: remove extra processing for the __signature__ attribute (GH-116234)
Sergey B Kirpichev [Tue, 8 Oct 2024 19:36:03 +0000 (22:36 +0300)] 
gh-116110: remove extra processing for the __signature__ attribute (GH-116234)

This is an alternative to GH-100168.

13 months agoMisc improvements to the itertools docs (gh-125147)
Raymond Hettinger [Tue, 8 Oct 2024 19:02:58 +0000 (14:02 -0500)] 
Misc improvements to the itertools docs (gh-125147)

13 months agogh-124832: Add a note to indicate that `datetime.now` may return the same instant...
spacemanspiff2007 [Tue, 8 Oct 2024 18:17:53 +0000 (20:17 +0200)] 
gh-124832: Add a note to indicate that `datetime.now` may return the same instant (#124834)

* Update datetime.rst

* Update datetime.rst

replace warning with note

* Update Doc/library/datetime.rst

Co-authored-by: Victor Stinner <vstinner@python.org>
* Update Doc/library/datetime.rst

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
---------

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
13 months agogh-125063: Emit slices as constants in the bytecode compiler (#125064)
Michael Droettboom [Tue, 8 Oct 2024 17:18:39 +0000 (13:18 -0400)] 
gh-125063: Emit slices as constants in the bytecode compiler (#125064)

* Make slices marshallable

* Emit slices as constants

* Update Python/marshal.c

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* Refactor codegen_slice into two functions so it
always has the same net effect

* Fix for free-threaded builds

* Simplify marshal loading of slices

* Only return SUCCESS/ERROR from codegen_slice

---------

Co-authored-by: Mark Shannon <mark@hotpy.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
13 months agogh-125084: Resolve paths in generator common code (GH-125085)
Cody Maloney [Tue, 8 Oct 2024 17:16:02 +0000 (10:16 -0700)] 
gh-125084: Resolve paths in generator common code (GH-125085)

In out of tree builds, the paths can contain `../ which needs to be
resolved for the relative path calculation to work.

13 months agogh-117721: use PyMutex in `_thread.lock` (#125110)
Kumar Aditya [Tue, 8 Oct 2024 14:47:32 +0000 (20:17 +0530)] 
gh-117721: use PyMutex in `_thread.lock` (#125110)

13 months agogh-124502: Optimize unicode_eq() (#125105)
Victor Stinner [Tue, 8 Oct 2024 14:25:24 +0000 (16:25 +0200)] 
gh-124502: Optimize unicode_eq() (#125105)

13 months agogh-115999: Stop the world when invalidating function versions (#124997)
mpage [Tue, 8 Oct 2024 14:04:35 +0000 (07:04 -0700)] 
gh-115999: Stop the world when invalidating function versions (#124997)

Stop the world when invalidating function versions

The tier1 interpreter specializes `CALL` instructions based on the values
of certain function attributes (e.g. `__code__`, `__defaults__`). The tier1
interpreter uses function versions to verify that the attributes of a function
during execution of a specialization match those seen during specialization.
A function's version is initialized in `MAKE_FUNCTION` and is invalidated when
any of the critical function attributes are changed. The tier1 interpreter stores
the function version in the inline cache during specialization. A guard is used by
the specialized instruction to verify that the version of the function on the operand
stack matches the cached version (and therefore has all of the expected attributes).
It is assumed that once the guard passes, all attributes will remain unchanged
while executing the rest of the specialized instruction.

Stopping the world when invalidating function versions ensures that all critical
function attributes will remain unchanged after the function version guard passes
in free-threaded builds. It's important to note that this is only true if the remainder
of the specialized instruction does not enter and exit a stop-the-world point.

We will stop the world the first time any of the following function attributes
are mutated:

- defaults
- vectorcall
- kwdefaults
- closure
- code

This should happen rarely and only happens once per function, so the performance
impact on majority of code should be minimal.

Additionally, refactor the API for manipulating function versions to more clearly
match the stated semantics.

13 months agogh-125096: Don't import _pyrepl in site if PYTHON_BASIC_REPL (#125097)
Victor Stinner [Tue, 8 Oct 2024 13:48:40 +0000 (15:48 +0200)] 
gh-125096: Don't import _pyrepl in site if PYTHON_BASIC_REPL (#125097)

If the PYTHON_BASIC_REPL environment variable is set, the site module
no longer imports the _pyrepl module.

Moreover, the site module now respects -E and -I command line
options: ignore PYTHON_BASIC_REPL in this case.

13 months agogh-112433 add versionadded for `ctypes.Structure._align_` (#125087)
monkeyman192 [Tue, 8 Oct 2024 12:41:46 +0000 (23:41 +1100)] 
gh-112433 add versionadded for `ctypes.Structure._align_` (#125087)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
13 months agoDoc: Improve description of ``GET_LEN`` opcode (#114583)
Kirill Podoprigora [Tue, 8 Oct 2024 12:25:40 +0000 (15:25 +0300)] 
Doc: Improve description of ``GET_LEN`` opcode (#114583)

13 months agogh-121404: typo fix in compile.c: MATADATA -> METADATA (#125101)
Mikhail Efimov [Tue, 8 Oct 2024 12:18:28 +0000 (15:18 +0300)] 
gh-121404: typo fix in compile.c: MATADATA -> METADATA (#125101)

13 months agogh-75898: make use of thread more explicit in the "Socket Programming HOWTO" document...
Jan Kaliszewski [Tue, 8 Oct 2024 12:13:37 +0000 (14:13 +0200)] 
gh-75898: make use of thread more explicit in the "Socket Programming HOWTO" document (#125023)

13 months agogh-90102: Fix pyio _isatty_open_only() (#125089)
Cody Maloney [Tue, 8 Oct 2024 11:49:50 +0000 (04:49 -0700)] 
gh-90102: Fix pyio _isatty_open_only() (#125089)

Spotted by @ngnpope.

`isatty` returns False to indicate the file is not a TTY. The C
implementation of _io does that (`Py_RETURN_FALSE`) but I got the
bool backwards in the _pyio implementaiton.

13 months agogh-123961: Convert _curses to a multi-phase init module (PEP-489) (#124965)
Bénédikt Tran [Tue, 8 Oct 2024 11:42:44 +0000 (13:42 +0200)] 
gh-123961: Convert _curses to a multi-phase init module (PEP-489) (#124965)

13 months agogh-123378: fix a crash in `UnicodeError.__str__` (#124935)
Bénédikt Tran [Tue, 8 Oct 2024 11:37:59 +0000 (13:37 +0200)] 
gh-123378: fix a crash in `UnicodeError.__str__` (#124935)

13 months agogh-53203: Improve tests for strptime() (GH-125090)
Serhiy Storchaka [Tue, 8 Oct 2024 08:40:02 +0000 (11:40 +0300)] 
gh-53203: Improve tests for strptime() (GH-125090)

Run them with different locales and different date and time.

Add the @run_with_locales() decorator to run the test with multiple
locales.

Improve the run_with_locale() context manager/decorator -- it now
catches only expected exceptions and reports the test as skipped if no
appropriate locale is available.

13 months agobpo-34206: Improve docs and test coverage for pre-init functions (#8023)
Alyssa Coghlan [Tue, 8 Oct 2024 08:34:11 +0000 (18:34 +1000)] 
bpo-34206: Improve docs and test coverage for pre-init functions (#8023)

- move the Py_Main documentation from the very high level API section
  to the initialization and finalization section
- make it clear that it encapsulates a full Py_Initialize/Finalize
  cycle of its own
- point out that exactly which settings will be read and applied
  correctly when Py_Main is called after a separate runtime
  initialization call is version dependent
- be explicit that Py_IsInitialized can be called prior to
  initialization
- actually test that Py_IsInitialized can be called prior to
  initialization
- flush stdout in the embedding tests that run code so it appears
  in the expected order when running with "-vv"
- make "-vv" on the subinterpreter embedding tests less spammy

---------

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
13 months agogh-69998: Fix decoding error in locale.nl_langinfo() (GH-124963)
Serhiy Storchaka [Tue, 8 Oct 2024 08:27:49 +0000 (11:27 +0300)] 
gh-69998: Fix decoding error in locale.nl_langinfo() (GH-124963)

The function now sets temporarily the LC_CTYPE locale to the locale
of the category that determines the requested value if the locales are
different and the resulting string is non-ASCII.
This temporary change affects other threads.

13 months agogh-70870: Clarify dual usage of 'free variable' (#122545)
Alyssa Coghlan [Tue, 8 Oct 2024 07:52:12 +0000 (17:52 +1000)] 
gh-70870: Clarify dual usage of 'free variable' (#122545)

The term "free variable" has unfortunately become genuinely
ambiguous over the years (presumably due to the names of
some relevant code object instance attributes).

While we can't eliminate that ambiguity at this late date, we can
at least alert people to the potential ambiguity by describing
both the formal meaning of the term and the common
alternative use as a direct synonym for "closure variable".

---------

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
13 months agogh-90102: Remove isatty call during regular open (#124922)
Cody Maloney [Tue, 8 Oct 2024 06:50:42 +0000 (23:50 -0700)] 
gh-90102: Remove isatty call during regular open (#124922)

Co-authored-by: Victor Stinner <vstinner@python.org>
13 months agoDocs: make a tutorial example more precise (#125066)
Ned Batchelder [Mon, 7 Oct 2024 23:41:13 +0000 (19:41 -0400)] 
Docs: make a tutorial example more precise (#125066)

Based on discussion here:

https://discuss.python.org/t/omission-in-the-documentation/66816

13 months agogh-125072: Add label for assignment expressions; update tracked section for assignmen...
Emily Morehouse [Mon, 7 Oct 2024 22:51:14 +0000 (16:51 -0600)] 
gh-125072: Add label for assignment expressions; update tracked section for assignment expression topic (#125074)

13 months agogh-124502: Add PyUnicode_Equal() function (#124504)
Victor Stinner [Mon, 7 Oct 2024 21:24:53 +0000 (23:24 +0200)] 
gh-124502: Add PyUnicode_Equal() function (#124504)

13 months agogh-122392: IDLE - Fix overlapping lines in browsers (#122392) (#124975)
Zhikang Yan [Mon, 7 Oct 2024 18:52:09 +0000 (02:52 +0800)] 
gh-122392: IDLE - Fix overlapping lines in browsers (#122392) (#124975)

Increase currently inadequate vertical spacing for the IDLE browsers (path,
module, and stack) on high-resolution monitors.
---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
13 months agogh-124653: Relax (again) detection of queue API for logging handlers (GH-124897)
Bénédikt Tran [Mon, 7 Oct 2024 18:42:19 +0000 (20:42 +0200)] 
gh-124653: Relax (again) detection of queue API for logging handlers  (GH-124897)

13 months agoUse _PyLong_GetOne() and _PyLong_GetZero() in long_invmod() (#125044)
Victor Stinner [Mon, 7 Oct 2024 17:54:42 +0000 (19:54 +0200)] 
Use _PyLong_GetOne() and _PyLong_GetZero() in long_invmod() (#125044)

These functions cannot fail.

13 months agogh-124182: Explain naming rules for struct sequence types (#124335)
ffelixg [Mon, 7 Oct 2024 17:52:34 +0000 (19:52 +0200)] 
gh-124182: Explain naming rules for struct sequence types (#124335)

13 months agogh-124956: Use `#undef` for temp macros in `_csv.c` (#124957)
sobolevn [Mon, 7 Oct 2024 17:35:56 +0000 (20:35 +0300)] 
gh-124956: Use `#undef` for temp macros in `_csv.c` (#124957)

13 months agoGH-121459: Streamline PyObject* to PyStackRef conversions by disallowing NULL pointer...
Mark Shannon [Mon, 7 Oct 2024 17:13:04 +0000 (18:13 +0100)] 
GH-121459: Streamline PyObject* to PyStackRef conversions by disallowing NULL pointers. (GH-124894)

13 months agogh-125018: Fix role syntax (#125050)
Adam Turner [Mon, 7 Oct 2024 16:51:53 +0000 (17:51 +0100)] 
gh-125018: Fix role syntax (#125050)

13 months agogh-120762: make_ssl_certs: Don't set extensions for the temporary CSR (GH-125045)
Petr Viktorin [Mon, 7 Oct 2024 15:37:52 +0000 (17:37 +0200)] 
gh-120762: make_ssl_certs: Don't set extensions for the temporary CSR (GH-125045)

gh-120762: make_ssl_certs: Don't set extensions for the CSR

`openssl req` fails with openssl 3.2.2 because the config line

    authorityKeyIdentifier = keyid:always,issuer:always

is not supported for certificate signing requests (since the issuing
certificate authority is not known).

David von Oheimb, the OpenSSL dev that made the change, commented in:
https://github.com/openssl/openssl/issues/22966#issuecomment-1858396738 :

> This problem did not show up in older OpenSSL versions because of a bug:
> the `req` app ignored the `-extensions` option unless `-x505` is given,
> which I fixed in https://github.com/openssl/openssl/pull/16865.

(I assume `-x505` is a typo for `-x509`.)

In our `make_cert_key` function:

If `sign` is true:
- We don't pass `-x509` to `req`, so in this case it should be safe to
  omit the `-extensions` argument. (Old OpenSSL ignores it, new OpenSSL
  fails on it.)
- The extensions are passed to the `ca` call later in the function.
  There they take effect, and `authorityKeyIdentifier` is valid.

If `sign` is false, this commit has no effect except rearranging the
CLI arguments.

13 months agoGH-119866: Spill the stack around escaping calls. (GH-124392)
Mark Shannon [Mon, 7 Oct 2024 13:56:39 +0000 (14:56 +0100)] 
GH-119866: Spill the stack around escaping calls. (GH-124392)

* Spill the evaluation around escaping calls in the generated interpreter and JIT.

* The code generator tracks live, cached values so they can be saved to memory when needed.

* Spills the stack pointer around escaping calls, so that the exact stack is visible to the cycle GC.

13 months agogh-125018: Add importlib.metadata semantic link targets (#125027)
Alyssa Coghlan [Mon, 7 Oct 2024 13:44:18 +0000 (23:44 +1000)] 
gh-125018: Add importlib.metadata semantic link targets (#125027)

This allows direct intersphinx references to APIs via references
like `` :func:`importlib.metadata.version` ``.

---------

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
13 months agogh-111178: Fix function signatures in fileio.c (#125043)
Victor Stinner [Mon, 7 Oct 2024 13:27:36 +0000 (15:27 +0200)] 
gh-111178: Fix function signatures in fileio.c (#125043)

* Add "fileio_" prefix to getter functions.
* Small refactoring.

13 months agogh-121249: Support _Complex types in the struct module (#121613)
Sergey B Kirpichev [Mon, 7 Oct 2024 11:53:02 +0000 (14:53 +0300)] 
gh-121249: Support _Complex types in the struct module (#121613)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
13 months agoGH-116968: Remove branch from advance_backoff_counter (GH-124469)
Mark Shannon [Mon, 7 Oct 2024 10:46:33 +0000 (11:46 +0100)] 
GH-116968: Remove branch from advance_backoff_counter (GH-124469)

13 months agoGH-109975: Announce final release in What's New in Python 3.13 (#125007)
Adam Turner [Mon, 7 Oct 2024 04:43:03 +0000 (05:43 +0100)] 
GH-109975: Announce final release in What's New in Python 3.13 (#125007)

Prepare What's New in Python 3.13 for final release

13 months agogh-125025: `_thread` docs: fix/update the *caveats* list (GH-125026)
Jan Kaliszewski [Sun, 6 Oct 2024 22:57:03 +0000 (00:57 +0200)] 
gh-125025: `_thread` docs: fix/update the *caveats* list (GH-125026)

13 months agoDoc: Simplify the definition of 'soft deprecated' (#124988)
Andrés Delfino [Sun, 6 Oct 2024 22:22:19 +0000 (19:22 -0300)] 
Doc: Simplify the definition of 'soft deprecated' (#124988)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
13 months agogh-125010: Fix `use-after-free` in AST `repr()` (#125015)
Tomas R. [Sun, 6 Oct 2024 19:46:03 +0000 (21:46 +0200)] 
gh-125010: Fix `use-after-free` in AST `repr()` (#125015)

13 months agogh-119535: python𝜋 (#119536)
Shantanu [Sun, 6 Oct 2024 18:47:13 +0000 (11:47 -0700)] 
gh-119535: python𝜋 (#119536)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
13 months agogh-125008: Fix `tokenize.untokenize` roundtrip for `\n{{` (#125013)
Tomas R. [Sun, 6 Oct 2024 13:16:41 +0000 (15:16 +0200)] 
gh-125008: Fix `tokenize.untokenize` roundtrip for `\n{{` (#125013)

13 months agogh-122951: Simplify the grammar of the assignment rule (#124998)
Rigel Di Scala [Sun, 6 Oct 2024 09:55:56 +0000 (11:55 +0200)] 
gh-122951: Simplify the grammar of the assignment rule (#124998)

13 months agogh-111178: Fix function signatures in genobject.c (#124970)
Victor Stinner [Sat, 5 Oct 2024 07:56:44 +0000 (09:56 +0200)] 
gh-111178: Fix function signatures in genobject.c (#124970)

* Add "CAST" macros.
* Rename parameters/variables "o" to "ag", "ags", "agw" or "agt"
  in some functions.

13 months agogh-112804: Clamping timeout value for _PySemaphore_PlatformWait (gh-124914)
Donghee Na [Sat, 5 Oct 2024 02:27:32 +0000 (11:27 +0900)] 
gh-112804: Clamping timeout value for _PySemaphore_PlatformWait (gh-124914)

* gh-112804: Clamping timeout value for _PySemaphore_PlatformWait

* Address code review

* nit

13 months agogh-124552 : Improve the accuracy of possible breakpoint check in bdb (#124553)
Tian Gao [Sat, 5 Oct 2024 01:32:57 +0000 (18:32 -0700)] 
gh-124552 : Improve the accuracy of possible breakpoint check in bdb (#124553)

13 months agogh-119786: Replace a Sphinx role with a link to `Python/errors.c` (#124990)
Adam Turner [Sat, 5 Oct 2024 00:00:19 +0000 (01:00 +0100)] 
gh-119786: Replace a Sphinx role with a link to `Python/errors.c` (#124990)

13 months agogh-117151: increase default buffer size of shutil.copyfileobj() to 256k. (GH-119783)
morotti [Fri, 4 Oct 2024 23:51:22 +0000 (00:51 +0100)] 
gh-117151: increase default buffer size of shutil.copyfileobj() to 256k. (GH-119783)

* gh-117151: increase default buffer size of shutil.copyfileobj() to 256k.

it was set to 16k in the 1990s.
it was raised to 64k in 2019. the discussion at the time mentioned another 5% improvement by raising to 128k and settled for a very conservative setting.

it's 2024 now, I think it should be revisited to match modern hardware. I am measuring 0-15% performance improvement when raising to 256k on various types of disk. there is no downside as far as I can tell.

this function is only intended for sequential copy of full files (or file like objects). it's the typical use case that benefits from larger operations.

for reference, I came across this function while trying to profile pip that is using it to copy files when installing python packages.

* add news

---------

Co-authored-by: rmorotti <romain.morotti@man.com>
13 months agogh-119786: move a few more details on exception handling from devguide to InternalDoc...
Irit Katriel [Fri, 4 Oct 2024 23:48:12 +0000 (00:48 +0100)] 
gh-119786: move a few more details on exception handling from devguide to InternalDocs (#124989)

13 months agogh-124871: fix 'visited' tracking in compiler's reachability analysis (#124952)
Irit Katriel [Fri, 4 Oct 2024 16:37:38 +0000 (17:37 +0100)] 
gh-124871: fix 'visited' tracking in compiler's reachability analysis (#124952)

13 months agogh-124962: Convert leftover rst to markup in `InternalDocs/compiler.md` (#124971)
isaacjones99 [Fri, 4 Oct 2024 14:23:02 +0000 (15:23 +0100)] 
gh-124962: Convert leftover rst to markup in `InternalDocs/compiler.md` (#124971)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
13 months agoFix console prompt syntax in What's New in Python 3.8 (#124968)
Nice Zombies [Fri, 4 Oct 2024 11:33:54 +0000 (13:33 +0200)] 
Fix console prompt syntax in What's New in Python 3.8 (#124968)

13 months agogh-118658: Modify cert generation script to extract cert3.pem (GH-124598)
Felix Fontein [Fri, 4 Oct 2024 11:15:08 +0000 (13:15 +0200)] 
gh-118658: Modify cert generation script to extract cert3.pem (GH-124598)

13 months agogh-111178: Fix function signatures in _threadmodule.c (#124964)
Victor Stinner [Fri, 4 Oct 2024 10:50:01 +0000 (12:50 +0200)] 
gh-111178: Fix function signatures in _threadmodule.c (#124964)

13 months agogh-109975: Suggest ``pynntp`` instead of ``nntplib`` (#124830)
Christian Clauss [Fri, 4 Oct 2024 10:21:03 +0000 (12:21 +0200)] 
gh-109975: Suggest ``pynntp`` instead of ``nntplib`` (#124830)

The ``nntplib`` library has been deleted from PyPI by its author.

13 months agogh-111178: Fix function signatures in classobject.c (#124943)
Victor Stinner [Fri, 4 Oct 2024 10:00:00 +0000 (12:00 +0200)] 
gh-111178: Fix function signatures in classobject.c (#124943)

13 months agogh-111178: Fix function signatures in bytearrayobject.c (#124940)
Victor Stinner [Fri, 4 Oct 2024 09:59:51 +0000 (11:59 +0200)] 
gh-111178: Fix function signatures in bytearrayobject.c (#124940)

13 months agogh-111178: Fix function signatures in Python-ast.c (#124942)
Victor Stinner [Fri, 4 Oct 2024 09:59:08 +0000 (11:59 +0200)] 
gh-111178: Fix function signatures in Python-ast.c (#124942)

13 months agogh-123961: Convert `curses.window` static type into a heap type (#124934)
Bénédikt Tran [Fri, 4 Oct 2024 09:58:34 +0000 (11:58 +0200)] 
gh-123961: Convert `curses.window` static type into a heap type (#124934)

13 months agogh-124613: Deactivate perf support in tests if the jit is set (#124794)
Pablo Galindo Salgado [Fri, 4 Oct 2024 00:00:32 +0000 (02:00 +0200)] 
gh-124613: Deactivate perf support in tests if the jit is set (#124794)

gh-124613: Deactivate the JIT during perf tests

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
13 months agoGH-109975: Copyedit 3.13 What's New: Remove references to the incremental GC (#124947)
Adam Turner [Thu, 3 Oct 2024 20:06:29 +0000 (21:06 +0100)] 
GH-109975: Copyedit 3.13 What's New: Remove references to the incremental GC (#124947)

13 months agoSimplify partial() rough equivalent code (gh-124941)
Raymond Hettinger [Thu, 3 Oct 2024 19:54:53 +0000 (14:54 -0500)] 
Simplify partial() rough equivalent code (gh-124941)

13 months agogh-124889: Remove redundant artificial rules in PEG parser (#124893)
efimov-mikhail [Thu, 3 Oct 2024 12:58:56 +0000 (15:58 +0300)] 
gh-124889: Remove redundant artificial rules in PEG parser (#124893)

Cache in C PEG-generator reworked:
we save artificial rules in cache by Node string representation as a key instead of Node object itself.
As a result total count of artificial rules in parsers.c is lowered from 283 to 170.
More natural number ordering is used for the names of artificial rules.

Auxiliary method CCallMakerVisitor._generate_artificial_rule_call is added.
Its purpose is abstracting work with artificial rules cache.

Explicit using of "is_repeat1" kwarg is added to visit_Repeat0 and visit_Repeat1 methods.
Its slightly improve code readabitily.

13 months agogh-123961: Clean up curses C API/capsule (#124907)
Bénédikt Tran [Thu, 3 Oct 2024 10:48:50 +0000 (12:48 +0200)] 
gh-123961: Clean up curses C API/capsule (#124907)

13 months agogh-115145: Update documentation about ``PyThreadState_DeleteCurrent`` (gh-124920)
Donghee Na [Thu, 3 Oct 2024 10:34:47 +0000 (19:34 +0900)] 
gh-115145: Update documentation about ``PyThreadState_DeleteCurrent`` (gh-124920)

13 months agogh-121982: ``csv``: Add a test case for invalid ``quoting`` constant. (#121983)
Tomas R [Thu, 3 Oct 2024 08:14:57 +0000 (10:14 +0200)] 
gh-121982: ``csv``: Add a test case for invalid ``quoting`` constant. (#121983)

Test invalid quoting constant

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
13 months agogh-124858: fix happy eyeballs refcyles (#124859)
Thomas Grainger [Wed, 2 Oct 2024 23:32:31 +0000 (00:32 +0100)] 
gh-124858: fix happy eyeballs refcyles (#124859)

13 months agoGH-118093: Don't lose confidence when tracing through 100% biased branches (GH-124813)
Brandt Bucher [Wed, 2 Oct 2024 19:24:37 +0000 (12:24 -0700)] 
GH-118093: Don't lose confidence when tracing through 100% biased branches (GH-124813)

13 months agoGH-119726: Deduplicate AArch64 trampolines within a trace (GH-123872)
Diego Russo [Wed, 2 Oct 2024 19:07:20 +0000 (20:07 +0100)] 
GH-119726: Deduplicate AArch64 trampolines within a trace (GH-123872)

13 months agogh-111178: Fix function signatures in funcobject.c (#124908)
Victor Stinner [Wed, 2 Oct 2024 17:29:56 +0000 (19:29 +0200)] 
gh-111178: Fix function signatures in funcobject.c (#124908)