]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
13 months agogh-124628: Pyrepl inputs on Windows shouldn't always be blocking reads (#124629)
Dino Viehland [Thu, 26 Sep 2024 22:10:36 +0000 (15:10 -0700)] 
gh-124628: Pyrepl inputs on Windows shouldn't always be blocking reads (#124629)

13 months agoRemove some unused files related to WASM/WASI (GH-124635)
Brett Cannon [Thu, 26 Sep 2024 21:23:41 +0000 (14:23 -0700)] 
Remove some unused files related to WASM/WASI (GH-124635)

13 months agogh-89683: add tests for `deepcopy` on frozen dataclasses (gh-123098)
Bénédikt Tran [Thu, 26 Sep 2024 21:15:28 +0000 (23:15 +0200)] 
gh-89683: add tests for `deepcopy` on frozen dataclasses (gh-123098)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
13 months agogh-119180: Rename SOURCE format to STRING (#124620)
Jelle Zijlstra [Thu, 26 Sep 2024 20:49:48 +0000 (13:49 -0700)] 
gh-119180: Rename SOURCE format to STRING (#124620)

13 months agogh-124612: Good bye dockerfile and use GHCR package (gh-124626)
Donghee Na [Thu, 26 Sep 2024 19:58:15 +0000 (12:58 -0700)] 
gh-124612: Good bye dockerfile and use GHCR package (gh-124626)

13 months agogh-115528: Update language reference for PEP 646 (#121181)
Matthew Rahtz [Thu, 26 Sep 2024 19:35:17 +0000 (20:35 +0100)] 
gh-115528: Update language reference for PEP 646 (#121181)

To recap: the objective is to make starred expressions valid in `subscription`,
which is used for generics: `Generic[...]`, `list[...]`, etc.

What _is_ gramatically valid in such contexts? Seemingly any of the following.
(At least, none of the following throw `SyntaxError` in a 3.12.3 REPL.)

    Generic[x]
    Generic[*x]
    Generic[*x, y]
    Generic[y, *x]
    Generic[x := 1]
    Generic[x := 1, y := 2]

So introducting

    flexible_expression: expression | assignment_expression | starred_item

end then switching `subscription` to use `flexible_expression` sorts that.

But then we need to field `yield` - for which any of the following are
apparently valid:

    yield x
    yield x,
    yield x, y
    yield *x,
    yield *x, *y

Introducing a separate `yield_list` is the simplest way I've been figure out to
do this - separating out the special case of `starred_item ,`.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
13 months agoProgramming FAQ: Mention object.__setattr__ as a technique for delegation (#124617)
Jelle Zijlstra [Thu, 26 Sep 2024 18:50:31 +0000 (11:50 -0700)] 
Programming FAQ: Mention object.__setattr__ as a technique for delegation (#124617)

This is used for example by threading.local in the stdlib.

13 months agoCleanup unnecessary curframe_locals usage (#124369)
Tian Gao [Thu, 26 Sep 2024 16:35:13 +0000 (09:35 -0700)] 
Cleanup unnecessary curframe_locals usage (#124369)

13 months agogh-124153: Remove `_PyType_GetModuleByDef2` private function (GH-124261)
neonene [Thu, 26 Sep 2024 16:21:11 +0000 (01:21 +0900)] 
gh-124153: Remove `_PyType_GetModuleByDef2` private function (GH-124261)

Thank you!

13 months agoDoc: Use the short version for daily downloads (#124602)
Adam Turner [Thu, 26 Sep 2024 15:44:25 +0000 (16:44 +0100)] 
Doc: Use the short version for daily downloads (#124602)

13 months agogh-124606: Fix reference leak in error path in `datetime_fromisoformat` in `_datetime...
Kirill Podoprigora [Thu, 26 Sep 2024 15:30:21 +0000 (18:30 +0300)] 
gh-124606: Fix reference leak in error path in `datetime_fromisoformat` in `_datetimemodule.c` (#124607)

Previously `tzdata` and `dtstr_clean` were not decrefed in the `invalid_iso_midnight` error path of the `datetime_isoformat` function.

13 months agogh-119127: Fix _functools.Placeholder singleton (#124601)
Victor Stinner [Thu, 26 Sep 2024 14:50:38 +0000 (16:50 +0200)] 
gh-119127: Fix _functools.Placeholder singleton (#124601)

* The module state now stores a strong reference to the Placeholder
  singleton.
* Use a regular dealloc function.
* Add Py_TPFLAGS_HAVE_GC flag and a traverse function to help the GC
  to collect the type when a _functools extension is unloaded.

13 months agogh-124498: Fix `TypeAliasType` not to be generic, when `type_params=()` (#124499)
sobolevn [Thu, 26 Sep 2024 14:15:38 +0000 (17:15 +0300)] 
gh-124498: Fix `TypeAliasType` not to be generic, when `type_params=()` (#124499)

13 months agogh-119127: functools: Improve docs for partial and Placeholder (#124575)
Jelle Zijlstra [Thu, 26 Sep 2024 14:12:56 +0000 (07:12 -0700)] 
gh-119127: functools: Improve docs for partial and Placeholder (#124575)

13 months agogh-118181: Fix parameter markup in AST docs (#124473)
Tomas R [Thu, 26 Sep 2024 13:38:25 +0000 (15:38 +0200)] 
gh-118181: Fix parameter markup in AST docs (#124473)

13 months agogh-123560: Correct docs for "empty" format type for floats (#123561)
Sergey B Kirpichev [Thu, 26 Sep 2024 12:40:18 +0000 (15:40 +0300)] 
gh-123560: Correct docs for "empty" format type for floats (#123561)

13 months agogh-124234: Improve docs for `Mock.reset_mock` (#124237)
sobolevn [Thu, 26 Sep 2024 12:06:52 +0000 (15:06 +0300)] 
gh-124234: Improve docs for `Mock.reset_mock` (#124237)

13 months agogh-124538: Fix crash when using `gc.get_referents` on an untracked capsule object...
Peter Bierma [Thu, 26 Sep 2024 10:29:43 +0000 (06:29 -0400)] 
gh-124538: Fix crash when using `gc.get_referents` on an untracked capsule object (#124559)

13 months agogh-124402: Speed up test_free_threading and test_super (#124491)
Victor Stinner [Thu, 26 Sep 2024 08:53:17 +0000 (10:53 +0200)] 
gh-124402: Speed up test_free_threading and test_super (#124491)

* Reduce the number of iterations and the number of threads so a
  whole test file takes less than a minute.
* Refactor test_racing_iter_extend() to remove two levels of
  indentation.
* test_monitoring() uses a sleep of 100 ms instead of 1 second.

13 months agogh-101100: Make __subclasses__ doctest stable (#124577)
Jelle Zijlstra [Thu, 26 Sep 2024 06:26:03 +0000 (23:26 -0700)] 
gh-101100: Make __subclasses__ doctest stable (#124577)

Using a standard library class makes this test difficult to maintain
as other tests and other parts of the stdlib may create subclasses,
which may still be alive when this test runs depending on GC timing.

13 months agogh-120284: Enhance `asyncio.run` to accept awaitable objects (#120566)
Ron Frederick [Thu, 26 Sep 2024 06:15:08 +0000 (23:15 -0700)] 
gh-120284: Enhance `asyncio.run` to accept awaitable objects (#120566)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
13 months agogh-119333: get interp from tstate for PyContext watchers(#124444)
Jason Fried [Thu, 26 Sep 2024 05:26:23 +0000 (22:26 -0700)] 
gh-119333: get interp from tstate for PyContext watchers(#124444)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
13 months agogh-124309: Modernize the `staggered_race` implementation to support eager task factor...
Peter Bierma [Thu, 26 Sep 2024 05:11:17 +0000 (01:11 -0400)] 
gh-124309: Modernize the `staggered_race` implementation to support eager task factories (#124390)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
13 months agogh-119127: functools.partial placeholders (gh-119827)
dgpb [Thu, 26 Sep 2024 01:04:38 +0000 (04:04 +0300)] 
gh-119127: functools.partial placeholders (gh-119827)

13 months agoAdd "annotate" SET_FUNCTION_ATTRIBUTE bit to dis. (#124566)
larryhastings [Thu, 26 Sep 2024 00:01:45 +0000 (17:01 -0700)] 
Add "annotate" SET_FUNCTION_ATTRIBUTE bit to dis. (#124566)

13 months agogh-124412: Add helpers for converting annotations to source format (#124551)
Jelle Zijlstra [Thu, 26 Sep 2024 00:01:09 +0000 (17:01 -0700)] 
gh-124412: Add helpers for converting annotations to source format (#124551)

13 months agogh-119180: Disallow instantiation of ConstEvaluator objects (#124561)
Jelle Zijlstra [Wed, 25 Sep 2024 23:30:17 +0000 (16:30 -0700)] 
gh-119180: Disallow instantiation of ConstEvaluator objects (#124561)

13 months agoFor-else deserves its own section in the tutorial (#123946)
Ned Batchelder [Wed, 25 Sep 2024 23:18:18 +0000 (19:18 -0400)] 
For-else deserves its own section in the tutorial (#123946)

* For-else deserves its own section in the tutorial

* remove mention of unrolling the loop

* Update Doc/tutorial/controlflow.rst

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
---------

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
13 months agoAdd 3.13 as a version option to the crash issue template (#124560)
Zachary Ware [Wed, 25 Sep 2024 23:09:37 +0000 (18:09 -0500)] 
Add 3.13 as a version option to the crash issue template (#124560)

13 months agogh-123242: Note that type.__annotations__ may not exist (#124557)
Jelle Zijlstra [Wed, 25 Sep 2024 23:08:14 +0000 (16:08 -0700)] 
gh-123242: Note that type.__annotations__ may not exist (#124557)

Closes #123242. The real criterion is that the attribute does not
exist on heap types, but I don't think we should discuss heap vs.
static types in the language reference.

13 months agogh-119180: Make FORWARDREF format look at __annotations__ first (#124479)
Jelle Zijlstra [Wed, 25 Sep 2024 22:32:45 +0000 (15:32 -0700)] 
gh-119180: Make FORWARDREF format look at __annotations__ first (#124479)

From discussion with Larry Hastings and Carl Meyer, this is the desired
behavior.

13 months agoGH-58058: Add quick reference for `ArgumentParser` to argparse docs (gh-124227)
Savannah Ostrowski [Wed, 25 Sep 2024 22:22:17 +0000 (15:22 -0700)] 
GH-58058: Add quick reference for `ArgumentParser` to argparse docs (gh-124227)

13 months agogh-41431: Add `datetime.time.strptime()` and `datetime.date.strptime()` (#120752)
Nice Zombies [Wed, 25 Sep 2024 21:43:58 +0000 (23:43 +0200)] 
gh-41431: Add `datetime.time.strptime()` and `datetime.date.strptime()` (#120752)

* Python implementation

* C implementation

* Test `date.strptime`

* Test `time.strptime`

* 📜🤖 Added by blurb_it.

* Update whatsnew

* Update documentation

* Add leap year note

* Update 2024-06-19-19-53-42.gh-issue-41431.gnkUc5.rst

* Apply suggestions from code review

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

* Use helper function

* Remove bad return

* Link to github issue

* Fix directive

* Apply suggestions from code review

Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
* Fix test cases

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
13 months agogh-102450: Add ISO-8601 alternative for midnight to `fromisoformat()` calls. (#105856)
TizzySaurus [Wed, 25 Sep 2024 21:32:51 +0000 (22:32 +0100)] 
gh-102450: Add ISO-8601 alternative for midnight to `fromisoformat()` calls. (#105856)

* Add NEWS.d entry

* Allow ISO-8601 24:00 alternative to midnight on datetime.time.fromisoformat()

* Allow ISO-8601 24:00 alternative to midnight on datetime.datetime.fromisoformat()

* Add NEWS.d entry

* Improve error message when hour is 24 and minute/second/microsecond is not 0

* Add tests for 24:00 fromisoformat

* Remove duplicate call to days_in_month() by storing in variable

* Add Python implementation

* Fix Lint

* Fix differing error msg in datetime.fromisoformat implementations when 24hrs has non-zero time component(s)

* Fix using time components inside tzinfo in Python implementation

* Don't parse tzinfo in C implementation when invalid iso midnight

* Remove duplicated variable in datetime test assertion line

* Add self to acknowledgements

* Remove duplicate NEWS entry

* Linting

* Add missing test case for when wrapping the year makes it invalid (too large)

13 months agogh-124370: Add "howto" for free-threaded Python (#124371)
Sam Gross [Wed, 25 Sep 2024 21:31:53 +0000 (14:31 -0700)] 
gh-124370: Add "howto" for free-threaded Python (#124371)

* gh-124370: Add "howto" for free-threaded Python

This is a guide aimed at people writing Python code, as oppposed to the
existing guide for C API extension authors.

* Add missing new line

* Update Doc/howto/free-threading-python.rst

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* interned -> immortalized

* Apply suggestions from code review

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* Update Doc/howto/free-threading-python.rst

Co-authored-by: mpage <mpage@cs.stanford.edu>
* Update docs

* Apply suggestions from code review

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* A few more updates

* Additional comment on immortal objects

* Mention specializing adaptive interpreter

* Remove trailing whitespace

* Remove mention of C macro

---------

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: mpage <mpage@cs.stanford.edu>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
13 months agogh-121277: Allow `.. versionadded:: next` in docs (GH-121278)
Petr Viktorin [Wed, 25 Sep 2024 21:30:40 +0000 (23:30 +0200)] 
gh-121277: Allow `.. versionadded:: next` in docs (GH-121278)

Make `versionchanged:: next`` expand to current (unreleased) version.

When a new CPython release is cut, the release manager will replace
all such occurences of "next" with the just-released version.
(See the issue for release-tools and devguide PRs.)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
13 months agogh-119400: make_ssl_certs: update reference test data automatically, pass in expirat...
Alexander Kanavin [Wed, 25 Sep 2024 21:23:47 +0000 (23:23 +0200)] 
gh-119400:  make_ssl_certs: update reference test data automatically, pass in expiration dates as parameters #119400  (GH-119401)

* Lib/test/certdata: do not hardcode reference cert data into tests

The script was simply printing the reference data and asking
users to update it by hand into the test suites. This can
be easily improved by writing the data into files and
having the test cases load the files.

* make_ssl_certs: make it possible to pass in expiration dates from command line

Note that in this commit, the defaults are same as they were,
so if nothing is specified the script works as before.

---------

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
13 months agogh-119180: Avoid going through AST and eval() when possible in annotationlib (#124337)
Jelle Zijlstra [Wed, 25 Sep 2024 21:14:03 +0000 (14:14 -0700)] 
gh-119180: Avoid going through AST and eval() when possible in annotationlib (#124337)

Often, ForwardRefs represent a single simple name. In that case, we
can avoid going through the overhead of creating AST nodes and code
objects and calling eval(): we can simply look up the name directly
in the relevant namespaces.

Co-authored-by: Victor Stinner <vstinner@python.org>
13 months agogh-124448: Update Windows builds to use Tcl/Tk 8.6.15 (GH-124449)
Zachary Ware [Wed, 25 Sep 2024 21:00:25 +0000 (16:00 -0500)] 
gh-124448: Update Windows builds to use Tcl/Tk 8.6.15 (GH-124449)

13 months agogh-123884 Tee of tee was not producing n independent iterators (gh-124490)
Raymond Hettinger [Wed, 25 Sep 2024 20:38:05 +0000 (13:38 -0700)] 
gh-123884 Tee of tee was not producing n independent iterators (gh-124490)

13 months agogh-124378: Update test_ttk for Tcl/Tk 8.6.15 (GH-124542)
Zachary Ware [Wed, 25 Sep 2024 20:16:32 +0000 (15:16 -0500)] 
gh-124378: Update test_ttk for Tcl/Tk 8.6.15 (GH-124542)

Co-authored-by: Marc Culler <culler@users.noreply.github.com>
13 months agogh-124513: Check args in framelocalsproxy_new() (#124515)
Victor Stinner [Wed, 25 Sep 2024 19:41:09 +0000 (21:41 +0200)] 
gh-124513: Check args in framelocalsproxy_new() (#124515)

Fix a crash in FrameLocalsProxy constructor: check the number of
arguments.

13 months agogh-101100: Add a table of class attributes to the "Custom classes" section of the...
Alex Waygood [Wed, 25 Sep 2024 19:29:58 +0000 (12:29 -0700)] 
gh-101100: Add a table of class attributes to the "Custom classes" section of the data model docs (#124480)

13 months agoDoc: Use ``major.minor`` for documentation distribution archive filenames (#124489)
Adam Turner [Wed, 25 Sep 2024 19:06:54 +0000 (20:06 +0100)] 
Doc: Use ``major.minor`` for documentation distribution archive filenames (#124489)

13 months agogh-117376: Fix off-by-ones in conversion functions (GH-124301)
Ken Jin [Wed, 25 Sep 2024 18:41:07 +0000 (02:41 +0800)] 
gh-117376: Fix off-by-ones in conversion functions (GH-124301)

Fix off-by-ones in conversion function

13 months agogh-123856: Fix PyREPL failure when a keyboard interrupt is triggered after using...
Emily Morehouse [Wed, 25 Sep 2024 18:22:03 +0000 (11:22 -0700)] 
gh-123856: Fix PyREPL failure when a keyboard interrupt is triggered after using a history search (#124396)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
13 months agogh-123756: Disable restart command if pdb is in inline mode (#123757)
Tian Gao [Wed, 25 Sep 2024 18:18:01 +0000 (11:18 -0700)] 
gh-123756: Disable restart command if pdb is in inline mode (#123757)

13 months agogh-112301: Use literal format strings in unicode_fromformat_arg (GH-124203)
Petr Viktorin [Wed, 25 Sep 2024 17:46:01 +0000 (19:46 +0200)] 
gh-112301: Use literal format strings in unicode_fromformat_arg (GH-124203)

13 months agoimport: permit __name__ for use in __name__ = "__main__": (#124381)
Thomas Grainger [Wed, 25 Sep 2024 17:39:14 +0000 (18:39 +0100)] 
import: permit __name__ for use in __name__ = "__main__": (#124381)

permit __name__ for use in __name__ = "__main__":

13 months agogh-123223: Adding hyperlink of argument in warnings.catch_warnings: (#123231)
Damien [Wed, 25 Sep 2024 17:30:34 +0000 (01:30 +0800)] 
gh-123223: Adding hyperlink of argument in warnings.catch_warnings: (#123231)

* Adding hyperlink of argument

* Modify as reviewer suggested

13 months agogh-123968: fix -f/--float command line option description (#124517)
Robert Wolff [Wed, 25 Sep 2024 16:47:45 +0000 (18:47 +0200)] 
gh-123968: fix -f/--float command line option description (#124517)

* fix -f/--float command line option description

See gh-123968 gh-124009

* Update Doc/library/random.rst

---------

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
13 months agogh-124285: Fix bug where bool() is called multiple times for the same part of a boole...
Irit Katriel [Wed, 25 Sep 2024 14:51:25 +0000 (15:51 +0100)] 
gh-124285: Fix bug where bool() is called multiple times for the same part of a boolean expression (#124394)

13 months agogh-123014: Disable pidfd API on older Android versions (#124458)
Malcolm Smith [Wed, 25 Sep 2024 14:23:30 +0000 (15:23 +0100)] 
gh-123014: Disable pidfd API on older Android versions (#124458)

13 months agogh-116622: Make test_unzip_zipfile recognize Android error message format (#124462)
Malcolm Smith [Wed, 25 Sep 2024 14:02:18 +0000 (15:02 +0100)] 
gh-116622: Make test_unzip_zipfile recognize Android error message format (#124462)

Make test_unzip_zipfile recognize Android error message format

13 months agogh-123445: calendar: Improve descriptions for day and month attributes (#123483)
Mat S [Wed, 25 Sep 2024 09:24:47 +0000 (10:24 +0100)] 
gh-123445: calendar: Improve descriptions for day and month attributes (#123483)

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
13 months agoDoc: Improve documentation for the ``path`` argument in ``shutil.which()`` (#124494)
Tom Most [Wed, 25 Sep 2024 07:54:13 +0000 (00:54 -0700)] 
Doc: Improve documentation for the ``path`` argument in ``shutil.which()`` (#124494)

13 months agoAdjust build_ubuntu_ssltests job to use cache for the correct OS version (GH-124403)
Zachary Ware [Wed, 25 Sep 2024 01:27:23 +0000 (20:27 -0500)] 
Adjust build_ubuntu_ssltests job to use cache for the correct OS version (GH-124403)

13 months agogh-90562: Support zero argument super with dataclasses when slots=True (gh-124455)
Eric V. Smith [Wed, 25 Sep 2024 01:26:26 +0000 (21:26 -0400)] 
gh-90562: Support zero argument super with dataclasses when slots=True (gh-124455)

Co-authored-by: @wookie184
Co-authored-by: Carl Meyer <carl@oddbird.net>
13 months agoGH-124408: Temporarily skip test_strftime_y2k for emulated Linux JIT CI (GH-124466)
Savannah Ostrowski [Wed, 25 Sep 2024 01:09:50 +0000 (18:09 -0700)] 
GH-124408: Temporarily skip test_strftime_y2k for emulated Linux JIT CI (GH-124466)

13 months agodataclasses: Avoid using private class (#124465)
Jelle Zijlstra [Tue, 24 Sep 2024 21:02:18 +0000 (14:02 -0700)] 
dataclasses: Avoid using private class (#124465)

typing.get_origin() does what we need here, without reaching into
typing internals. This shouldn't change any behavior (so I am going
to skip news), but it sets a good example for other users introspecting
typing objects.

13 months agogh-124402: Require cpu resource in test_super slow method (#124434)
Victor Stinner [Tue, 24 Sep 2024 20:36:45 +0000 (22:36 +0200)] 
gh-124402: Require cpu resource in test_super slow method (#124434)

test___class___modification_multithreaded() now requires the 'cpu'
test resource on a Free Threaded build.

13 months agogh-86009: Fix solaris detection in `_USE_CP_SENDFILE` check (GH-124289)
Jakub Kulík [Tue, 24 Sep 2024 20:23:17 +0000 (22:23 +0200)] 
gh-86009: Fix solaris detection in `_USE_CP_SENDFILE` check (GH-124289)

13 months agogh-123923: Defer refcounting for `f_funcobj` in `_PyInterpreterFrame` (#124026)
Sam Gross [Tue, 24 Sep 2024 20:08:18 +0000 (13:08 -0700)] 
gh-123923: Defer refcounting for `f_funcobj` in `_PyInterpreterFrame` (#124026)

Use a `_PyStackRef` and defer the reference to `f_funcobj` when
possible. This avoids some reference count contention in the common case
of executing the same code object from multiple threads concurrently in
the free-threaded build.

13 months agobpo-44864: Do not translate user-provided strings in ArgumentParser.add_subparsers...
Jérémie Detrey [Tue, 24 Sep 2024 19:54:50 +0000 (21:54 +0200)] 
bpo-44864: Do not translate user-provided strings in ArgumentParser.add_subparsers() (GH-27667)

Call _() on literal strings only.

13 months agogh-120254: Add a `commands` argument to `pdb.set_trace` (#120255)
Tian Gao [Tue, 24 Sep 2024 19:52:15 +0000 (12:52 -0700)] 
gh-120254: Add a `commands` argument to `pdb.set_trace` (#120255)

13 months agogh-124448: Update bundled Tcl/Tk in macOS installer to 8.6.15. (#124453)
Ned Deily [Tue, 24 Sep 2024 19:49:58 +0000 (12:49 -0700)] 
gh-124448: Update bundled Tcl/Tk in macOS installer to 8.6.15. (#124453)

13 months agogh-124405: Fix `NameError` in `openpty` (#124406)
sobolevn [Tue, 24 Sep 2024 18:06:39 +0000 (21:06 +0300)] 
gh-124405: Fix `NameError` in `openpty` (#124406)

13 months agoGH-124398: Pin LLVM to 18.1.0 for Windows JIT CI (GH-124399)
Savannah Ostrowski [Tue, 24 Sep 2024 17:03:16 +0000 (10:03 -0700)] 
GH-124398: Pin LLVM to 18.1.0 for Windows JIT CI (GH-124399)

13 months agoGH-87358: Add clarification about nargs and default argparse behaviour (#124094)
Savannah Ostrowski [Tue, 24 Sep 2024 16:30:01 +0000 (09:30 -0700)] 
GH-87358: Add clarification about nargs and default argparse behaviour (#124094)

13 months agogh-124402: Require cpu resource in test_free_threading (#124438)
Victor Stinner [Tue, 24 Sep 2024 14:33:27 +0000 (16:33 +0200)] 
gh-124402: Require cpu resource in test_free_threading (#124438)

Require the 'cpu' test resource on slow test_free_threading tests.

13 months agogh-113008: Correct argparse usage output for required, mutually exclusive groups...
Payton [Tue, 24 Sep 2024 14:14:35 +0000 (09:14 -0500)] 
gh-113008:  Correct argparse usage output for required, mutually exclusive groups (GH-113085)

13 months agogh-59317: Improve parsing optional positional arguments in argparse (GH-124303)
Serhiy Storchaka [Tue, 24 Sep 2024 12:46:41 +0000 (15:46 +0300)] 
gh-59317: Improve parsing optional positional arguments in argparse (GH-124303)

Fix parsing positional argument with nargs equal to '?' or '*' if it is
preceded by an option and another positional argument.

13 months agogh-65169: Clarify prog default in argparse (GH-31602)
Stanley [Tue, 24 Sep 2024 10:57:37 +0000 (03:57 -0700)] 
gh-65169: Clarify prog default in argparse (GH-31602)

13 months agogh-123978: Remove broken time.thread_time() on NetBSD (GH-124116)
Serhiy Storchaka [Tue, 24 Sep 2024 08:26:25 +0000 (11:26 +0300)] 
gh-123978: Remove broken time.thread_time() on NetBSD (GH-124116)

13 months agogh-124188: Fix PyErr_ProgramTextObject() (GH-124189)
Serhiy Storchaka [Tue, 24 Sep 2024 08:01:37 +0000 (11:01 +0300)] 
gh-124188: Fix PyErr_ProgramTextObject() (GH-124189)

* Detect source file encoding.
* Use the "replace" error handler even for UTF-8 (default) encoding.
* Remove the BOM.
* Fix detection of too long lines if they contain NUL.
* Return the head rather than the tail for truncated long lines.

13 months agogh-72795: Make positional arguments with nargs='*' or REMAINDER non-required (GH...
Serhiy Storchaka [Tue, 24 Sep 2024 07:55:33 +0000 (10:55 +0300)] 
gh-72795: Make positional arguments with nargs='*' or REMAINDER non-required (GH-124306)

This allows to use positional argument with nargs='*' and without default
in mutually exclusive group and improves error message about required
arguments.

13 months agogh-53780: Ignore the first "--" (double dash) between an option and command in argpar...
Serhiy Storchaka [Tue, 24 Sep 2024 07:35:28 +0000 (10:35 +0300)] 
gh-53780: Ignore the first "--" (double dash) between an option and command in argparse (GH-124275)

13 months agogh-63143: Fix parsing mutually exclusive arguments in argparse (GH-124307)
Serhiy Storchaka [Tue, 24 Sep 2024 07:23:07 +0000 (10:23 +0300)] 
gh-63143: Fix parsing mutually exclusive arguments in argparse (GH-124307)

Arguments with the value identical to the default value (e.g. booleans,
small integers, empty or 1-character strings) are no longer considered
"not present".

13 months agogh-124120: Document `Annotated.__origin__` (#124125)
sobolevn [Tue, 24 Sep 2024 06:53:04 +0000 (09:53 +0300)] 
gh-124120: Document `Annotated.__origin__` (#124125)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
13 months agogh-124127: Make Py_REFCNT() opaque in limited C API 3.14 (#124128)
Victor Stinner [Tue, 24 Sep 2024 06:42:58 +0000 (08:42 +0200)] 
gh-124127: Make Py_REFCNT() opaque in limited C API 3.14 (#124128)

13 months agogh-124130: Increase test coverage for \b and \B in regular expressions (GH-124330)
Serhiy Storchaka [Tue, 24 Sep 2024 06:31:10 +0000 (09:31 +0300)] 
gh-124130: Increase test coverage for \b and \B in regular expressions (GH-124330)

13 months agoFix typos (#124409)
Xie Yanbo [Tue, 24 Sep 2024 06:19:25 +0000 (14:19 +0800)] 
Fix typos (#124409)

13 months agogh-119180: Add discussion of annotations to the 3.14 What's New (#124393)
Jelle Zijlstra [Tue, 24 Sep 2024 05:50:13 +0000 (22:50 -0700)] 
gh-119180: Add discussion of annotations to the 3.14 What's New (#124393)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
13 months agogh-119333: Add C api to have contextvar enter/exit callbacks (#119335)
Jason Fried [Tue, 24 Sep 2024 03:40:17 +0000 (20:40 -0700)] 
gh-119333: Add C api to have contextvar enter/exit callbacks (#119335)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
13 months agogh-123990: Good bye WITH_FREELISTS macro (gh-124358)
Donghee Na [Tue, 24 Sep 2024 01:28:59 +0000 (18:28 -0700)] 
gh-123990: Good bye WITH_FREELISTS macro (gh-124358)

13 months agogh-100980: ctypes: Test, document, and fix finalizing _fields_ (GH-124292)
Petr Viktorin [Tue, 24 Sep 2024 00:40:53 +0000 (02:40 +0200)] 
gh-100980: ctypes: Test, document, and fix finalizing _fields_ (GH-124292)

- If setting `_fields_` fails, e.g. with AttributeError, don't set the attribute in `__dict__`
- Document the “finalization” behaviour
- Beef up tests: add `getattr`, test Union as well as Structure
- Put common functionality in a common function

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
13 months agoLint and format Tools/build/check-warnings.py (#124382)
Hugo van Kemenade [Mon, 23 Sep 2024 23:47:05 +0000 (16:47 -0700)] 
Lint and format Tools/build/check-warnings.py (#124382)

13 months agogh-119004: fix a crash in equality testing between `OrderedDict` (#121329)
Bénédikt Tran [Mon, 23 Sep 2024 23:44:36 +0000 (01:44 +0200)] 
gh-119004: fix a crash in equality testing between `OrderedDict` (#121329)

13 months agogh-116622: Complete Android documentation (#124259)
Malcolm Smith [Mon, 23 Sep 2024 23:09:53 +0000 (00:09 +0100)] 
gh-116622: Complete Android documentation (#124259)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: T. Wouters <thomas@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
13 months agogh-124102: Update internal PCbuild docs to accurately list build dependencies (GH...
Wulian [Mon, 23 Sep 2024 23:09:22 +0000 (07:09 +0800)] 
gh-124102: Update internal PCbuild docs to accurately list build dependencies (GH-124103)

13 months agoBump Ruff to 0.6.7 (#124384)
Alex Waygood [Mon, 23 Sep 2024 22:19:35 +0000 (15:19 -0700)] 
Bump Ruff to 0.6.7 (#124384)

13 months agoDoc: Add ``make dist-no-html`` (#124383)
Adam Turner [Mon, 23 Sep 2024 22:11:34 +0000 (23:11 +0100)] 
Doc: Add ``make dist-no-html`` (#124383)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
13 months agoGH-65961: Document the deprecation of `__package__` and `__cached__` (GH-124377)
Brett Cannon [Mon, 23 Sep 2024 21:14:33 +0000 (14:14 -0700)] 
GH-65961: Document the deprecation of `__package__` and `__cached__` (GH-124377)

The code changes for warning related to `__package__` landed in Python 3.12. `__cached__` doesn't have any changes as it isn't used but only set by the import system.

13 months agogh-99108: Disable HACL SIMD code on older versions of Android (#124304)
Malcolm Smith [Mon, 23 Sep 2024 20:28:03 +0000 (21:28 +0100)] 
gh-99108: Disable HACL SIMD code on older versions of Android (#124304)

Disable HACL SIMD code on older versions of Android

13 months agoGH-87041: Fix incorrect indentation in argparse help (GH-124230)
Savannah Ostrowski [Mon, 23 Sep 2024 19:45:36 +0000 (12:45 -0700)] 
GH-87041: Fix incorrect indentation in argparse help (GH-124230)

In case of usage a long command along with max_help_position more than
the length of the command, the command's help was incorrectly started
on the new line.

Co-authored-by: Pavel Ditenbir <pavel.ditenbir@gmail.com>
13 months agoGH-109975: Copyedit 3.13 What's New: Trivia (#124348)
Adam Turner [Mon, 23 Sep 2024 19:32:23 +0000 (20:32 +0100)] 
GH-109975: Copyedit 3.13 What's New: Trivia (#124348)

13 months agogh-124344: Make `_PyObject_IS_GC()` use underscored `PyType_IS_GC()` (#124349)
neonene [Mon, 23 Sep 2024 19:14:15 +0000 (04:14 +0900)] 
gh-124344: Make `_PyObject_IS_GC()` use underscored `PyType_IS_GC()` (#124349)

move up _PyType_IS_GC and use it

13 months agogh-119180: Fix annotationlib.ForwardRef.evaluate with no globals (#124326)
Jelle Zijlstra [Mon, 23 Sep 2024 19:06:19 +0000 (12:06 -0700)] 
gh-119180: Fix annotationlib.ForwardRef.evaluate with no globals (#124326)

We were sometimes passing None as the globals argument to eval(), which makes it
inherit the globals from the calling scope. Instead, ensure that globals is always
non-None. The test was passing accidentally because I passed "annotationlib" as a
module object; fix that. Also document the parameters to ForwardRef() and remove
two unused private ones.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
13 months agoGH-109975: Copyedit 3.13 What's New: Copyedit C API deprecations pending removal...
Adam Turner [Mon, 23 Sep 2024 18:40:20 +0000 (19:40 +0100)] 
GH-109975: Copyedit 3.13 What's New: Copyedit C API deprecations pending removal (#124336)

13 months agoGH-109975: Copyedit 3.13 What's New: Build Changes (#124343)
Adam Turner [Mon, 23 Sep 2024 18:30:45 +0000 (19:30 +0100)] 
GH-109975: Copyedit 3.13 What's New: Build Changes (#124343)

Co-authored-by: Malcolm Smith <smith@chaquo.com>