]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
12 months agogh-125041: test_zlib: For s390x HW acceleration, only skip checking the compressed...
Petr Viktorin [Tue, 15 Oct 2024 11:29:43 +0000 (13:29 +0200)] 
gh-125041: test_zlib: For s390x HW acceleration, only skip checking the compressed bytes (#125042)

12 months agogh-119535: Support 𝜋thon in Python 3.14 venvs (#125035)
foreignmeloman [Tue, 15 Oct 2024 10:26:19 +0000 (14:26 +0400)] 
gh-119535: Support 𝜋thon in Python 3.14 venvs (#125035)

12 months agogh-125196: Use PyUnicodeWriter in HAMT (#125458)
Victor Stinner [Tue, 15 Oct 2024 09:47:36 +0000 (11:47 +0200)] 
gh-125196: Use PyUnicodeWriter in HAMT (#125458)

12 months agogh-125234: Make PyInitConfig_Free(NULL) a no-op (#125266)
RUANG (Roy James) [Tue, 15 Oct 2024 09:21:16 +0000 (17:21 +0800)] 
gh-125234: Make PyInitConfig_Free(NULL) a no-op (#125266)

12 months agogh-53203: Fix strptime() tests for %X on glibc < 2.29 (#125469)
Serhiy Storchaka [Tue, 15 Oct 2024 08:05:40 +0000 (11:05 +0300)] 
gh-53203: Fix strptime() tests for %X on glibc < 2.29 (#125469)

12 months agogh-123299: Copyedit "What's New in Python 3.14" (#125438)
Hugo van Kemenade [Tue, 15 Oct 2024 07:39:15 +0000 (10:39 +0300)] 
gh-123299: Copyedit "What's New in Python 3.14" (#125438)

12 months agoDoc: Update CVE URL (#125489)
Mariusz Felisiak [Tue, 15 Oct 2024 07:29:08 +0000 (09:29 +0200)] 
Doc: Update CVE URL (#125489)

12 months agogh-125269: Use `AC_LINK_IF_ELSE` to detect if `-latomic` is needed (#125416)
Sam Gross [Tue, 15 Oct 2024 00:09:48 +0000 (20:09 -0400)] 
gh-125269: Use `AC_LINK_IF_ELSE` to detect if `-latomic` is needed (#125416)

We previously used `AC_RUN_IF_ELSE` with a short test program to detect
if `-latomic` is needed, but that requires choosing a specific default
value when cross-compiling because the test program is not run.
Some cross compilation targets like `wasm32-emscripten` do not support
`-latomic`, while other cross compilation targets, like
`arm-linux-gnueabi` require it.

12 months agogh-124958: Revert "gh-125472: Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture...
Thomas Grainger [Mon, 14 Oct 2024 22:45:58 +0000 (23:45 +0100)] 
gh-124958: Revert "gh-125472: Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles ... (#125486)

* Revert "gh-125472: Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#12… (#125476)"

This reverts commit e99650b80ace3893c2a80b3f2a4aca99cb305191.

* fix incompatability with gh-124392

12 months agogh-124944: Add socket.SO_ORIGINAL_DST (#124945)
Steven Jin [Mon, 14 Oct 2024 22:36:38 +0000 (18:36 -0400)] 
gh-124944: Add socket.SO_ORIGINAL_DST (#124945)

12 months agogh-85453: Improve variable mark up for datetime.rst (#120702)
edson duarte [Mon, 14 Oct 2024 22:02:58 +0000 (19:02 -0300)] 
gh-85453: Improve variable mark up for datetime.rst (#120702)

Variables and literals are marked up using backticks.

12 months agoFix idlelib typos (#125484)
Terry Jan Reedy [Mon, 14 Oct 2024 21:11:58 +0000 (17:11 -0400)] 
Fix idlelib typos (#125484)

Propagate fixes in Doc/library/idle.rst to help.html.
Change 'interruptable' to 'interruptible' in run.py.
The latter was reported by ember91 in PR 125473.

12 months agogh-125470: Fix warning in `Python/generated_cases.c.h` (#125471)
sobolevn [Mon, 14 Oct 2024 20:46:17 +0000 (23:46 +0300)] 
gh-125470: Fix warning in `Python/generated_cases.c.h` (#125471)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
12 months agogh-124872: Replace enter/exit events with "switched" (#124776)
Richard Hansen [Mon, 14 Oct 2024 19:28:41 +0000 (15:28 -0400)] 
gh-124872: Replace enter/exit events with "switched" (#124776)

Users want to know when the current context switches to a different
context object.  Right now this happens when and only when a context
is entered or exited, so the enter and exit events are synonymous with
"switched".  However, if the changes proposed for gh-99633 are
implemented, the current context will also switch for reasons other
than context enter or exit.  Since users actually care about context
switches and not enter or exit, replace the enter and exit events with
a single switched event.

The former exit event was emitted just before exiting the context.
The new switched event is emitted after the context is exited to match
the semantics users expect of an event with a past-tense name.  If
users need the ability to clean up before the switch takes effect,
another event type can be added in the future.  It is not added here
because YAGNI.

I skipped 0 in the enum as a matter of practice.  Skipping 0 makes it
easier to troubleshoot when code forgets to set zeroed memory, and it
aligns with best practices for other tools (e.g.,
https://protobuf.dev/programming-guides/dos-donts/#unspecified-enum).

12 months agogh-125472: Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#12...
Kirill Podoprigora [Mon, 14 Oct 2024 17:59:13 +0000 (20:59 +0300)] 
gh-125472: Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#12… (#125476)

Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#124959)"

This reverts commit d5dbbf4372cd3dbf3eead1cc70ddc4261c061fd9.

12 months agogh-119786: [doc] broken link and typo fix in interpreter_definition.md (#125455)
Mikhail Efimov [Mon, 14 Oct 2024 17:24:54 +0000 (20:24 +0300)] 
gh-119786: [doc] broken link and typo fix in interpreter_definition.md  (#125455)

12 months agogh-125461: Remove Python 2 from identifiers in doc (GH-125462)
Paul Hoffman [Mon, 14 Oct 2024 15:26:57 +0000 (08:26 -0700)] 
gh-125461: Remove Python 2 from identifiers in doc (GH-125462)

Remove Python 2 from identifiers in doc

12 months agogh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#124959)
Thomas Grainger [Mon, 14 Oct 2024 15:19:56 +0000 (16:19 +0100)] 
gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#124959)

12 months agogh-112088: aclocal version is updated to 1.16.5 in docs (#125457)
Mikhail Efimov [Mon, 14 Oct 2024 14:53:08 +0000 (17:53 +0300)] 
gh-112088: aclocal version is updated to 1.16.5 in docs (#125457)

12 months agogh-111178: fix USAN failures for `partialobject` (#124733)
Bénédikt Tran [Mon, 14 Oct 2024 14:23:05 +0000 (16:23 +0200)] 
gh-111178: fix USAN failures for `partialobject` (#124733)

12 months agogh-124960: Fixed `barry_as_FLUFL` future flag does not work in new REPL (#124999)
Wulian [Mon, 14 Oct 2024 13:53:50 +0000 (21:53 +0800)] 
gh-124960: Fixed `barry_as_FLUFL` future flag does not work in new REPL (#124999)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
12 months agogh-53203: Fix strptime() for %c, %x and %X formats on many locales (GH-125406)
Serhiy Storchaka [Mon, 14 Oct 2024 13:29:20 +0000 (16:29 +0300)] 
gh-53203: Fix strptime() for %c, %x and %X formats on many locales (GH-125406)

Fixed most locales that use non-ASCII digits, like Persian, Burmese,
Odia and Shan.

12 months agoGH-125323: Convert DECREF_INPUTS_AND_REUSE_FLOAT into a function that takes PyStackRe...
Mark Shannon [Mon, 14 Oct 2024 13:18:57 +0000 (14:18 +0100)] 
GH-125323: Convert DECREF_INPUTS_AND_REUSE_FLOAT into a function that takes PyStackRefs. (GH-125439)

12 months agogh-125139: use `_PyRecursiveMutex` in `_thread.RLock` (#125144)
Kumar Aditya [Mon, 14 Oct 2024 08:36:31 +0000 (14:06 +0530)] 
gh-125139: use `_PyRecursiveMutex` in `_thread.RLock` (#125144)

12 months agogh-121798: Add class method Decimal.from_number() (GH-121801)
Serhiy Storchaka [Mon, 14 Oct 2024 08:24:01 +0000 (11:24 +0300)] 
gh-121798: Add class method Decimal.from_number() (GH-121801)

It is an alternate constructor which only accepts a single numeric argument.
Unlike to Decimal.from_float() it accepts also Decimal.
Unlike to the standard constructor, it does not accept strings and tuples.

12 months agogh-125323: Remove some unsafe Py_DECREFs in bytecodes.c, replacing them with PyStackR...
Ken Jin [Mon, 14 Oct 2024 08:17:51 +0000 (16:17 +0800)] 
gh-125323: Remove some unsafe Py_DECREFs in bytecodes.c, replacing them with PyStackRef_CLOSEs (GH-125324)

12 months agogh-121797: Add class method Fraction.from_number() (GH-121800)
Serhiy Storchaka [Mon, 14 Oct 2024 07:54:59 +0000 (10:54 +0300)] 
gh-121797: Add class method Fraction.from_number() (GH-121800)

It is an alternative constructor which only accepts a single numeric argument.
Unlike to Fraction.from_float() and Fraction.from_decimal() it accepts any
real numbers supported by the standard constructor (int, float, Decimal,
Rational numbers, objects with as_integer_ratio()).
Unlike to the standard constructor, it does not accept strings.

12 months agogh-86357: argparse: use str() consistently and explicitly to print choices (GH-117766)
rindeal [Mon, 14 Oct 2024 06:36:53 +0000 (06:36 +0000)] 
gh-86357: argparse: use str() consistently and explicitly to print choices (GH-117766)

Signed-off-by: Jan Chren ~rindeal <dev.rindeal@gmail.com>
12 months agogh-123133: clarify p=0 case for "f" and "e" formatting types (GH-125426)
Sergey B Kirpichev [Mon, 14 Oct 2024 04:44:48 +0000 (07:44 +0300)] 
gh-123133: clarify p=0 case for "f" and "e" formatting types (GH-125426)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
12 months agogh-125243: Fix ZoneInfo data race in free threading build (#125281)
Sam Gross [Sun, 13 Oct 2024 20:17:51 +0000 (16:17 -0400)] 
gh-125243: Fix ZoneInfo data race in free threading build (#125281)

Lock `ZoneInfoType` to protect accesses to `ZONEINFO_STRONG_CACHE`.
Refactor the `tp_new` handler to use Argument Clinic so that we can just
use `@critical_section` annotations on the relevant functions.

Also use `PyDict_SetDefaultRef` instead of `PyDict_SetDefault` when
inserting into the `TIMEDELTA_CACHE`.

12 months agoGH-125069: Fix inconsistent joining in `WindowsPath(PosixPath(...))` (#125156)
Barney Gale [Sun, 13 Oct 2024 17:46:10 +0000 (18:46 +0100)] 
GH-125069: Fix inconsistent joining in `WindowsPath(PosixPath(...))` (#125156)

`PurePath.__init__()` incorrectly uses the `_raw_paths` of a given
`PurePath` object with a different flavour, even though the procedure to
join path segments can differ between flavours.

This change makes the `_raw_paths`-enabled deferred joining apply _only_
when the path flavours match.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
12 months agogh-101291: Add versionadded directives for PyUnstable_Long_* (#125384)
Sergey B Kirpichev [Sun, 13 Oct 2024 17:38:42 +0000 (20:38 +0300)] 
gh-101291: Add versionadded directives for PyUnstable_Long_* (#125384)

12 months agoadd Kumar Aditya as codeowner for weakref (#125405)
Kumar Aditya [Sun, 13 Oct 2024 16:59:27 +0000 (22:29 +0530)] 
add Kumar Aditya as codeowner for weakref (#125405)

12 months agogh-125403: fix console formatting in Chapter 12 of the tutorial (#125404)
partev [Sun, 13 Oct 2024 16:46:15 +0000 (12:46 -0400)] 
gh-125403: fix console formatting in Chapter 12 of the tutorial (#125404)

12 months agogh-89967: make WeakKeyDictionary and WeakValueDictionary thread safe (#125325)
Kumar Aditya [Sun, 13 Oct 2024 15:35:05 +0000 (21:05 +0530)] 
gh-89967: make WeakKeyDictionary and WeakValueDictionary thread safe (#125325)

Make `WeakKeyDictionary` and `WeakValueDictionary` thread safe by copying the underlying the dict before iterating over it.

12 months agogh-125161: return non zero value in pthread_self on wasi (#125303)
Kumar Aditya [Sun, 13 Oct 2024 15:29:41 +0000 (20:59 +0530)] 
gh-125161: return non zero value in pthread_self on wasi (#125303)

12 months agofix comment in _PyMutex_TryUnlock (#125319)
Kumar Aditya [Sun, 13 Oct 2024 15:29:07 +0000 (20:59 +0530)] 
fix comment in _PyMutex_TryUnlock (#125319)

12 months agogh-125383: Update `fib` function comment for accuracy (#125386)
Wulian [Sun, 13 Oct 2024 11:10:59 +0000 (19:10 +0800)] 
gh-125383: Update `fib` function comment for accuracy (#125386)

`Doc/tutorial/controlflow.rst`: fix comment for `fib` function

12 months agogh-61698: Use launchctl to detect macOS window manager in tests (#118390)
Erlend E. Aasland [Sun, 13 Oct 2024 08:22:31 +0000 (10:22 +0200)] 
gh-61698: Use launchctl to detect macOS window manager in tests (#118390)

12 months agogh-86673: Loosen test_ttk.test_identify() requirements (#125335)
Erlend E. Aasland [Sun, 13 Oct 2024 07:38:47 +0000 (09:38 +0200)] 
gh-86673: Loosen test_ttk.test_identify() requirements (#125335)

In aeca373b3 (PR gh-12011, issue gh-71500), test_identify() was changed to expect different results on Darwin. Ned's fix was later adjusted by e52f9bee8. This workaround is only needed for some variants of Tk/Tcl on macOS, so we now allow both the workaround and the generic results for these tests.

12 months agoTrivial change: Update comments in activate about what running hash -r does (GH-125385)
Andrew Athan [Sun, 13 Oct 2024 07:22:05 +0000 (00:22 -0700)] 
Trivial change: Update comments in activate about what running hash -r does (GH-125385)

Update comments about what running hash -r does

The old comment said "hash -r" forgets "past commands." However, the documentation for "hash" states that it forgets past locations. The old comment was, in my opinion, confusing. This is because it could be interpreted to mean it does something to the command history (HISTORY/HISTFILE etc) vs the cache of locations.

12 months agoDoc: Fix suggested usage of `-X gil=0` in the glossary (#125366)
Ruoyu Zhong [Sun, 13 Oct 2024 00:53:28 +0000 (08:53 +0800)] 
Doc: Fix suggested usage of `-X gil=0` in the glossary (#125366)

Currently, the "global interpreter lock" entry in the glossary mentions
that `-X gil 0` can be used to disable the GIL [1]. However, this is
invalid; the correct usage should be `-X gil=0`.

    $ python -X gil 0 -c 'print("Hello, world")'
    Fatal Python error: config_read_gil: PYTHON_GIL / -X gil must be "0" or "1"
    Python runtime state: preinitialized

    $ python -X gil=0 -c 'print("Hello, world")'
    Hello, world

[1]: https://docs.python.org/3/using/cmdline.html#cmdoption-X

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
12 months agogh-124872: Change PyContext_WatchCallback to take PyObject (#124737)
Richard Hansen [Sat, 12 Oct 2024 20:57:27 +0000 (16:57 -0400)] 
gh-124872: Change PyContext_WatchCallback to take PyObject (#124737)

The PyContext struct is not intended to be public, and users of the
API don't need anything more specific than PyObject.  Also see
gh-78943.

12 months agogh-125289: Update sample code in asyncio-task.rst (GH-125292)
Ghorban M. Tavakoly [Sat, 12 Oct 2024 20:38:13 +0000 (00:08 +0330)] 
gh-125289: Update sample code in asyncio-task.rst (GH-125292)

* Update sample code in asyncio-task.rst

This will change **coroutines** sample code in the **Awaitables** section and make the example clearer.

* Update Doc/library/asyncio-task.rst

Revert the added print

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* Update Doc/library/asyncio-task.rst

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
---------

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
12 months agoPrefer "similar" over "equivalent" in tutorial (#125343)
Stephen Rosen [Sat, 12 Oct 2024 20:21:55 +0000 (15:21 -0500)] 
Prefer "similar" over "equivalent" in tutorial (#125343)

In the datastructures tutorial doc, some operations are described as
"equivalent to" others. This has led to some user-confusion -- at
least in the Discourse forums -- about cases in which the operations
differ.

This change doesn't systematically eliminate the word "equivalent"
from the tutorial. It just substitutes "similar to" in several cases
in which "equivalent to" could mislead users into expecting exact
equivalence.

12 months agogh-124872: Move PyThreadState to first argument for consistency (#124774)
Richard Hansen [Sat, 12 Oct 2024 19:33:00 +0000 (15:33 -0400)] 
gh-124872: Move PyThreadState to first argument for consistency (#124774)

12 months agogh-53203: Fix strptime() for %c and %x formats on many locales (GH-124946)
Serhiy Storchaka [Sat, 12 Oct 2024 17:46:21 +0000 (20:46 +0300)] 
gh-53203: Fix strptime() for %c and %x formats on many locales (GH-124946)

In some locales (like French or Hebrew) the full or abbreviated names of
the default month and weekday used in __calc_date_time can be part of
other name or constant part of the %c format. The month name can also
match %m with constant suffix (like in Japanese). So the code failed to
correctly distinguish formats %a, %A, %b, %B and %m.

Cycle all month and all days of the week to find the variable part
and distinguish %a from %A and %b from %B or %m.

Fixed locales for the following languges:
Arabic, Bislama, Breton, Bodo, Kashubian, Chuvash, Estonian, French, Irish,
Ge'ez, Gurajati, Manx Gaelic, Hebrew, Hindi, Chhattisgarhi, Haitian Kreyol,
Japanese, Kannada, Korean, Marathi, Malay, Norwegian, Nynorsk, Punjabi,
Rajasthani, Tok Pisin, Yoruba, Yue Chinese, Yau/Nungon and Chinese.

Co-authored-by: Eli Bendersky <eliben@gmail.com>
12 months agogh-125260: Change the default ``gzip.compress()`` mtime to 0 (#125261)
Bernhard M. Wiedemann [Sat, 12 Oct 2024 17:18:48 +0000 (19:18 +0200)] 
gh-125260: Change the default ``gzip.compress()`` mtime to 0 (#125261)

This follows GNU gzip, which defaults to using 0 as the mtime
for compressing stdin, where no file mtime is involved.

This makes the output of gzip.compress() deterministic by default,
greatly helping reproducible builds.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
12 months agogh-85935: Check for nargs=0 for positional arguments in argparse (GH-124839)
Serhiy Storchaka [Sat, 12 Oct 2024 13:04:17 +0000 (16:04 +0300)] 
gh-85935: Check for nargs=0 for positional arguments in argparse (GH-124839)

Raise ValueError in add_argument() if either explicit nargs=0 or action
that does not consume arguments (like 'store_const' or 'store_true') is
specified for positional argument.

12 months agogh-125254: Fix error report about ambiguous option in argparse (GH-125273)
Serhiy Storchaka [Sat, 12 Oct 2024 12:15:37 +0000 (15:15 +0300)] 
gh-125254: Fix error report about ambiguous option in argparse (GH-125273)

This was a regression introduced in gh-58573. It was only tested for the
case when the ambiguous option is the last argument in the command line.

12 months agogh-85935: Explicitly document the case nargs=0 in argparse (GH-125302)
Serhiy Storchaka [Sat, 12 Oct 2024 11:53:00 +0000 (14:53 +0300)] 
gh-85935: Explicitly document the case nargs=0 in argparse (GH-125302)

12 months agogh-59330: Improve error message for dest= for positionals (GH-125215)
Serhiy Storchaka [Sat, 12 Oct 2024 11:46:28 +0000 (14:46 +0300)] 
gh-59330: Improve error message for dest= for positionals (GH-125215)

Also improve the documentation. Specify how dest and metavar are derived
from add_argument() positional arguments.

Co-authored-by: Simon Law <sfllaw@sfllaw.ca>
12 months agogh-65865: Raise early errors for invalid help strings in argparse (GH-124899)
Serhiy Storchaka [Sat, 12 Oct 2024 10:10:50 +0000 (13:10 +0300)] 
gh-65865: Raise early errors for invalid help strings in argparse (GH-124899)

12 months agogh-125196: Use PyUnicodeWriter in parser (#125271)
Victor Stinner [Sat, 12 Oct 2024 07:28:34 +0000 (09:28 +0200)] 
gh-125196: Use PyUnicodeWriter in parser (#125271)

Replace the private _PyUnicodeWriter API with the public
PyUnicodeWriter API in _PyPegen_concatenate_strings().

12 months agogh-111924: use atomics for interp id refcounting (#125321)
Kumar Aditya [Sat, 12 Oct 2024 07:10:34 +0000 (12:40 +0530)] 
gh-111924: use atomics for interp id refcounting  (#125321)

12 months agoDoc: Fix a typo in "Function Examples" in the control-flow tutorial (#125338)
Rafael Fontenelle [Sat, 12 Oct 2024 00:40:33 +0000 (21:40 -0300)] 
Doc: Fix a typo in "Function Examples" in the control-flow tutorial (#125338)

12 months agogh-124309: fix staggered race on eager tasks (#124847)
Thomas Grainger [Fri, 11 Oct 2024 23:31:06 +0000 (00:31 +0100)] 
gh-124309: fix staggered race on eager tasks (#124847)

This patch is entirely by Thomas and Peter

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
12 months agogh-116938: Clarify documentation of `dict` and `dict.update` regarding the positional...
Victorien [Fri, 11 Oct 2024 23:05:13 +0000 (01:05 +0200)] 
gh-116938: Clarify documentation of `dict` and `dict.update` regarding the positional argument they accept (#125213)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
12 months agogh-119786: Move garbage collection doc from devguide to InternalDocs (#125282)
Irit Katriel [Fri, 11 Oct 2024 20:18:37 +0000 (21:18 +0100)] 
gh-119786: Move garbage collection doc from devguide to InternalDocs (#125282)

Co-Authored-By: Carol Willing carolcode@willingconsulting.com
Co-Authored-By: Ezio Melotti ezio.melotti@gmail.com
Co-Authored-By: Hugo van Kemenade hugovk@users.noreply.github.com
Co-Authored-By: Itamar Ostricher itamarost@gmail.com
Co-Authored-By: Jesús Cea jcea@jcea.es
Co-Authored-By: Joannah Nanjekye 33177550+nanjekyejoannah@users.noreply.github.com
Co-Authored-By: Ned Batchelder ned@nedbatchelder.com
Co-Authored-By: Pablo Galindo Salgado Pablogsal@gmail.com
Co-Authored-By: Pamela Fox pamela.fox@gmail.com
Co-Authored-By: Sam Gross colesbury@gmail.com
Co-Authored-By: Stefan Pochmann 609905+pochmann@users.noreply.github.com
Co-Authored-By: T. Wouters thomas@python.org
Co-Authored-By: q-ata 24601033+q-ata@users.noreply.github.com
Co-Authored-By: slateny 46876382+slateny@users.noreply.github.com
Co-Authored-By: Борис Верховский boris.verk@gmail.com
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Jacob Coffee <jacob@z7x.org>
12 months agoFix typo in ``Doclibrary/functions.rst`` (#125327)
Rafael Fontenelle [Fri, 11 Oct 2024 20:00:31 +0000 (17:00 -0300)] 
Fix typo in ``Doclibrary/functions.rst`` (#125327)

12 months agogh-124917: Allow keyword args to os.path.exists/lexists on Windows (#124918)
Jelle Zijlstra [Fri, 11 Oct 2024 19:41:59 +0000 (12:41 -0700)] 
gh-124917: Allow keyword args to os.path.exists/lexists on Windows (#124918)

12 months agogh-116738: Make `_csv` module thread-safe (#118344)
AN Long [Fri, 11 Oct 2024 17:55:36 +0000 (01:55 +0800)] 
gh-116738: Make `_csv` module thread-safe (#118344)

12 months agogh-124612: Update autoconf container image (#125320)
Donghee Na [Fri, 11 Oct 2024 15:27:26 +0000 (00:27 +0900)] 
gh-124612: Update autoconf container image (#125320)

12 months agogh-124787: Fix `TypeAliasType` and incorrect `type_params` (#124795)
sobolevn [Fri, 11 Oct 2024 14:39:18 +0000 (17:39 +0300)] 
gh-124787: Fix `TypeAliasType` and incorrect `type_params` (#124795)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
12 months agogh-125235: Keep `_tkinter` TCL paths pointing to base installation on Windows (#125250)
Y5 [Fri, 11 Oct 2024 09:08:03 +0000 (09:08 +0000)] 
gh-125235: Keep `_tkinter` TCL paths pointing to base installation on Windows (#125250)

Signed-off-by: y5c4l3 <y5c4l3@proton.me>
12 months agogh-61011: Fix inheritance of nested mutually exclusive groups in argparse (GH-125210)
Serhiy Storchaka [Fri, 11 Oct 2024 08:43:29 +0000 (11:43 +0300)] 
gh-61011: Fix inheritance of nested mutually exclusive groups in argparse (GH-125210)

Previously, all nested mutually exclusive groups lost their connection
to the group containing them and were displayed as belonging directly
to the parser.

Co-authored-by: Danica J. Sutherland <djsutherland@users.noreply.github.com>
12 months agogh-125058: update `_thread` docs regarding interruptibility of `lock.acquire()` ...
Jan Kaliszewski [Fri, 11 Oct 2024 08:15:46 +0000 (10:15 +0200)] 
gh-125058: update `_thread` docs regarding interruptibility of `lock.acquire()` (#125141)

12 months agogh-125221: Fix free-threading data race in `object.__reduce_ex__` (#125267)
Sam Gross [Fri, 11 Oct 2024 07:56:01 +0000 (03:56 -0400)] 
gh-125221: Fix free-threading data race in `object.__reduce_ex__` (#125267)

12 months agogh-125296: Fix strange fragment identifier for `name or flags` in argparse docs ...
Savannah Ostrowski [Fri, 11 Oct 2024 06:30:27 +0000 (23:30 -0700)] 
gh-125296: Fix strange fragment identifier for `name or flags` in argparse docs (#125297)

12 months agogh-124872: Rename blurb file to reference the correct issue (#125285)
Richard Hansen [Fri, 11 Oct 2024 02:39:17 +0000 (22:39 -0400)] 
gh-124872: Rename blurb file to reference the correct issue (#125285)

12 months agoAdd some doctest cleanups for `turtle` and `configparser` (#125288)
Alex Waygood [Thu, 10 Oct 2024 23:53:45 +0000 (00:53 +0100)] 
Add some doctest cleanups for `turtle` and `configparser` (#125288)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
12 months agoDoc: Upgrade Sphinx to 8.1 (#125276)
Adam Turner [Thu, 10 Oct 2024 20:26:01 +0000 (21:26 +0100)] 
Doc: Upgrade Sphinx to 8.1 (#125276)

12 months agogh-125268: Use static string for "1e309" in AST (#125272)
Sam Gross [Thu, 10 Oct 2024 20:21:29 +0000 (16:21 -0400)] 
gh-125268: Use static string for "1e309" in AST (#125272)

When formatting the AST as a string, infinite values are replaced by
1e309, which evaluates to infinity. The initialization of this string
replacement was not thread-safe in the free threading build.

12 months agogh-125196: Use PyUnicodeWriter for repr(dict) (#125270)
Victor Stinner [Thu, 10 Oct 2024 18:41:14 +0000 (20:41 +0200)] 
gh-125196: Use PyUnicodeWriter for repr(dict) (#125270)

12 months agoNote argparse exit code in documentation (GH-119568)
Justin Kunimune [Thu, 10 Oct 2024 17:56:05 +0000 (13:56 -0400)] 
Note argparse exit code in documentation (GH-119568)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
12 months agoGH-125174: Make immortal objects more robust, following design from PEP 683 (GH-125251)
Mark Shannon [Thu, 10 Oct 2024 17:19:08 +0000 (18:19 +0100)] 
GH-125174: Make immortal objects more robust, following design from PEP 683 (GH-125251)

12 months agogh-124570: ctypes: Run some Structure tests on Union as well (GH-124976)
Petr Viktorin [Thu, 10 Oct 2024 14:27:52 +0000 (16:27 +0200)] 
gh-124570: ctypes: Run some Structure tests on Union as well (GH-124976)

- Move some Structure tests to test_structunion; use a common base
  test class + two subclasses to run them on Union too
- Remove test_union for now as it's redundant

Note: `test_simple_structs` & `test_simple_unions` are in the common
file because they share `formats`.

12 months agogh-125196: Use PyUnicodeWriter for JSON encoder (#125249)
Victor Stinner [Thu, 10 Oct 2024 13:33:00 +0000 (15:33 +0200)] 
gh-125196: Use PyUnicodeWriter for JSON encoder (#125249)

Replace the private _PyUnicodeWriter with the public PyUnicodeWriter.

12 months agogh-124153: Simplify PyType_GetBaseByToken (GH-124488)
neonene [Thu, 10 Oct 2024 12:57:13 +0000 (21:57 +0900)] 
gh-124153: Simplify PyType_GetBaseByToken (GH-124488)

12 months agogh-125118: don't copy arbitrary values to _Bool in the struct module (GH-125169)
Sergey B Kirpichev [Thu, 10 Oct 2024 12:42:03 +0000 (15:42 +0300)] 
gh-125118: don't copy arbitrary values to _Bool in the struct module (GH-125169)

memcopy'ing arbitrary values to _Bool variable triggers undefined
behaviour. Avoid this.
We assume that `false` is represented by all zero bytes.

Credits to Alex Gaynor.

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
12 months agogh-124471: Set name for unnamed reusable workflow (#124475)
Donghee Na [Thu, 10 Oct 2024 12:39:53 +0000 (21:39 +0900)] 
gh-124471: Set name for unnamed reusable workflow (#124475)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
12 months agogh-71784: [doc] add usage examples for traceback.TracebackException (#125189)
Irit Katriel [Thu, 10 Oct 2024 10:21:12 +0000 (11:21 +0100)] 
gh-71784: [doc] add usage examples for traceback.TracebackException (#125189)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
12 months agogh-125196: Use PyUnicodeWriter for repr(tuple) (#125242)
Victor Stinner [Thu, 10 Oct 2024 10:20:53 +0000 (12:20 +0200)] 
gh-125196: Use PyUnicodeWriter for repr(tuple) (#125242)

12 months agogh-125196: Add a free list to PyUnicodeWriter (#125227)
Victor Stinner [Thu, 10 Oct 2024 10:11:06 +0000 (12:11 +0200)] 
gh-125196: Add a free list to PyUnicodeWriter (#125227)

12 months agoPin the doctest workflow to Ubuntu 22.04 (#125236)
Adam Turner [Thu, 10 Oct 2024 09:34:55 +0000 (10:34 +0100)] 
Pin the doctest workflow to Ubuntu 22.04 (#125236)

12 months agogh-124872: Refine contextvars documentation (#124773)
Richard Hansen [Wed, 9 Oct 2024 23:44:03 +0000 (19:44 -0400)] 
gh-124872: Refine contextvars documentation (#124773)

* Add definitions for "context", "current context", and "context
    management protocol".
  * Update related definitions to be consistent with the new
    definitions.
  * Restructure the documentation for the `contextvars.Context` class
    to prepare for adding context manager support, and for consistency
    with the definitions.
  * Use `testcode` and `testoutput` to test the `Context.run` example.
  * Expand the documentation for the `Py_CONTEXT_EVENT_ENTER` and
    `Py_CONTEXT_EVENT_EXIT` events to clarify and to prepare for
    planned changes.

12 months agogh-125196: Use PyUnicodeWriter for repr(contextvars.Token) (#125220)
Victor Stinner [Wed, 9 Oct 2024 23:37:14 +0000 (01:37 +0200)] 
gh-125196: Use PyUnicodeWriter for repr(contextvars.Token) (#125220)

Replace the private _PyUnicodeWriter with the public PyUnicodeWriter.

12 months agogh-125196: PyUnicodeWriter_Discard(NULL) does nothing (#125222)
Victor Stinner [Wed, 9 Oct 2024 23:32:02 +0000 (01:32 +0200)] 
gh-125196: PyUnicodeWriter_Discard(NULL) does nothing (#125222)

12 months agogh-124969: Skip the test for ALT_DIGITS also on iOS (#125177)
Serhiy Storchaka [Wed, 9 Oct 2024 23:30:14 +0000 (02:30 +0300)] 
gh-124969: Skip the test for ALT_DIGITS also on iOS (#125177)

Skip the locale.ALT_DIGITS test on all Apple platforms, not just macOS.

12 months agogh-125140: Remove the current directory from sys.path when using pyrepl (GH-125212)
Pablo Galindo Salgado [Wed, 9 Oct 2024 22:30:56 +0000 (23:30 +0100)] 
gh-125140: Remove the current directory from sys.path when using pyrepl (GH-125212)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
12 months agogh-125196: Use PyUnicodeWriter for repr(structseq) (#125219)
Victor Stinner [Wed, 9 Oct 2024 22:04:50 +0000 (00:04 +0200)] 
gh-125196: Use PyUnicodeWriter for repr(structseq) (#125219)

Replace the private _PyUnicodeWriter with the public PyUnicodeWriter.

* Avoid temporary PyUnicode_DecodeUTF8(): call
  PyUnicodeWriter_WriteUTF8() instead.
* Avoid temporary PyObject_Repr(): call PyUnicodeWriter_WriteRepr()
  instead.

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.