]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
13 months agogh-123497: New limit for Python integers on 64-bit platforms (GH-123724)
Serhiy Storchaka [Sun, 29 Sep 2024 07:40:20 +0000 (10:40 +0300)] 
gh-123497: New limit for Python integers on 64-bit platforms (GH-123724)

Instead of be limited just by the size of addressable memory (2**63
bytes), Python integers are now also limited by the number of bits, so
the number of bit now always fit in a 64-bit integer.

Both limits are much larger than what might be available in practice,
so it doesn't affect users.

_PyLong_NumBits() and _PyLong_Frexp() are now always successful.

13 months agoGH-124639: add back loop param to staggered_race (#124700)
Kumar Aditya [Sun, 29 Sep 2024 03:12:46 +0000 (08:42 +0530)] 
GH-124639: add back loop param to staggered_race (#124700)

13 months agogh-124665: Add `_PyCodec_UnregisterError` and `_codecs._unregister_error` (#124677)
Bénédikt Tran [Sun, 29 Sep 2024 00:25:23 +0000 (02:25 +0200)] 
gh-124665: Add `_PyCodec_UnregisterError` and `_codecs._unregister_error` (#124677)

13 months agogh-124442: make `__static_attributes__` deterministic by sorting (#124492)
Kira [Sat, 28 Sep 2024 22:15:43 +0000 (01:15 +0300)] 
gh-124442: make `__static_attributes__` deterministic by sorting (#124492)

Signed-off-by: kp2pml30 <kp2pml30@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
13 months agogh-123339: Fix cases of inconsistency of __module__ and __firstlineno__ in classes...
Serhiy Storchaka [Sat, 28 Sep 2024 17:51:49 +0000 (20:51 +0300)] 
gh-123339: Fix cases of inconsistency of __module__ and __firstlineno__ in classes (GH-123613)

* Setting the __module__ attribute for a class now removes the
  __firstlineno__ item from the type's dict.
* The _collections_abc and _pydecimal modules now completely replace the
  collections.abc and decimal modules after importing them. This
  allows to get the source of classes and functions defined in these
  modules.
* inspect.findsource() now checks whether the first line number for a
  class is out of bound.

13 months agogh-124688: _decimal: Get module state from ctx for performance (#124691)
neonene [Sat, 28 Sep 2024 16:12:53 +0000 (01:12 +0900)] 
gh-124688: _decimal: Get module state from ctx for performance (#124691)

Get a module state from ctx objects for performance.

13 months agodocs: improve venv docs (#124540)
Jelle Zijlstra [Sat, 28 Sep 2024 12:50:09 +0000 (05:50 -0700)] 
docs: improve venv docs (#124540)

- Move "versionchanged" notes that apply to the whole class to the
  end of the class docs
- Remove or move notes next to the method list that apply to individual
  methods.
- Mark up parameters using the appropriate syntax
- Do not capitalize "boolean"
- Shorten some text

13 months agoDoc: Fix default ``latex_elements['papersize']`` (#124525)
Jean-François B. [Sat, 28 Sep 2024 10:30:28 +0000 (12:30 +0200)] 
Doc: Fix default ``latex_elements['papersize']`` (#124525)

https://www.sphinx-doc.org/en/master/latex.html#the-latex-elements-configuration-setting

It should be 'letterpaper' or 'a4paper' not 'letter' or 'a4'
(not to be confused with PAPER env variable).

13 months agoSorting techniques edits (#124701)
Raymond Hettinger [Sat, 28 Sep 2024 00:19:44 +0000 (17:19 -0700)] 
Sorting techniques edits (#124701)

13 months agogh-107954: Fix configuration type for the perf profiler (#124636)
Pablo Galindo Salgado [Fri, 27 Sep 2024 23:50:16 +0000 (16:50 -0700)] 
gh-107954: Fix configuration type for the perf profiler (#124636)

13 months agogh-124385: Document and soft-deprecate PyLong_AS_LONG (GH-124386)
Petr Viktorin [Fri, 27 Sep 2024 23:40:50 +0000 (01:40 +0200)] 
gh-124385: Document and soft-deprecate PyLong_AS_LONG (GH-124386)

13 months agogh-123299: Copy-edit the 3.14 What's New (#124670)
Jelle Zijlstra [Fri, 27 Sep 2024 22:25:33 +0000 (15:25 -0700)] 
gh-123299: Copy-edit the 3.14 What's New (#124670)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
13 months agogh-111178: fix some USAN failures - mismatched function pointers (GH-123004)
Bénédikt Tran [Fri, 27 Sep 2024 21:51:50 +0000 (23:51 +0200)] 
gh-111178: fix some USAN failures - mismatched function pointers (GH-123004)

13 months agoGH-124547: Clear instance dictionary if memory error occurs during object dealloc...
Mark Shannon [Fri, 27 Sep 2024 21:51:01 +0000 (14:51 -0700)] 
GH-124547: Clear instance dictionary if memory error occurs during object dealloc (GH-124627)

13 months agogh-90190: Add doc for using `singledispatch` with precise collection type hints ...
Matt Delengowski [Fri, 27 Sep 2024 21:10:29 +0000 (17:10 -0400)] 
gh-90190: Add doc for using `singledispatch` with precise collection type hints (#116544)

13 months agogh-81263: Add assignment expressions to `help` (#124641)
Emily Morehouse [Fri, 27 Sep 2024 20:59:26 +0000 (13:59 -0700)] 
gh-81263: Add assignment expressions to `help` (#124641)

* Add assignment expression (:=) to `help`

* Update index for Assignment Expressions to include pair of `assignment; expression`

13 months agogh-124457: Remove coverity from CPython repo (GH-124460)
Mariatta [Fri, 27 Sep 2024 20:42:32 +0000 (13:42 -0700)] 
gh-124457: Remove coverity from CPython repo (GH-124460)

Remove coverity from CPython repo.

13 months agogh-124520: What's New entry for ctypes metaclass __new__/__init__ change (GH-124546)
Petr Viktorin [Fri, 27 Sep 2024 20:13:53 +0000 (22:13 +0200)] 
gh-124520: What's New entry for ctypes metaclass __new__/__init__ change (GH-124546)

13 months agodoc: PyUnicode_AsUTF8String() fails if string contains surrogates (#124605)
Victor Stinner [Fri, 27 Sep 2024 20:13:29 +0000 (22:13 +0200)] 
doc: PyUnicode_AsUTF8String() fails if string contains surrogates (#124605)

13 months agoDrop code ownership for decimal (gh-124695)
Raymond Hettinger [Fri, 27 Sep 2024 19:33:16 +0000 (12:33 -0700)] 
Drop code ownership for decimal (gh-124695)

13 months agoFix typo in InternalDocs/string_interning.md (GH-124699)
Petr Viktorin [Fri, 27 Sep 2024 19:31:59 +0000 (21:31 +0200)] 
Fix typo in InternalDocs/string_interning.md (GH-124699)

13 months agogh-124609: Fix _Py_ThreadId for Windows builds using MinGW (#124663)
Tony Roberts [Fri, 27 Sep 2024 18:52:23 +0000 (19:52 +0100)] 
gh-124609: Fix _Py_ThreadId for Windows builds using MinGW (#124663)

13 months agoItertool docs: Minor clarifications, wording tweaks, spacing, and active voice. ...
Raymond Hettinger [Fri, 27 Sep 2024 18:43:46 +0000 (11:43 -0700)] 
Itertool docs: Minor clarifications, wording tweaks, spacing, and active voice. (gh-124690)

Minor clarifications, wording tweaks, spacing, and active voice.

13 months agogh-124682: Disable test that is prone to intermittent failure on iOS. (#124683)
Russell Keith-Magee [Fri, 27 Sep 2024 17:49:35 +0000 (10:49 -0700)] 
gh-124682: Disable test that is prone to intermittent failure on iOS. (#124683)

Disable test that is prone to intermittent failure on iOS.

13 months agogh-121277: Raise nice error on `next` as second argument to deprecated-removed (GH...
Petr Viktorin [Fri, 27 Sep 2024 17:38:40 +0000 (19:38 +0200)] 
gh-121277: Raise nice error on `next` as second argument to deprecated-removed (GH-124623)

13 months agoFixup indentation for docs on `ModuleSpec` attributes (#124681)
Alex Waygood [Fri, 27 Sep 2024 17:35:09 +0000 (10:35 -0700)] 
Fixup indentation for docs on `ModuleSpec` attributes (#124681)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
13 months agoImprove accuracy of kde() invcdf estimates (gh-124637)
Raymond Hettinger [Fri, 27 Sep 2024 16:56:37 +0000 (09:56 -0700)] 
Improve accuracy of kde() invcdf estimates (gh-124637)

13 months agoGH-118093: Fix off-by-one errors in tier-up thresholds (GH-124447)
Brandt Bucher [Fri, 27 Sep 2024 16:38:04 +0000 (09:38 -0700)] 
GH-118093: Fix off-by-one errors in tier-up thresholds (GH-124447)

13 months agogh-113878: Add `doc` parameter to `dataclasses.field` (gh-114051)
sobolevn [Fri, 27 Sep 2024 16:20:49 +0000 (19:20 +0300)] 
gh-113878: Add `doc` parameter to `dataclasses.field` (gh-114051)

If using `slots=True`, the `doc` parameter ends up in the `__slots__` dict. The `doc` parameter is also in the corresponding `Field` object.

13 months agogh-123017: Add Android to the list of platforms where `strftime` doesn't support...
Malcolm Smith [Fri, 27 Sep 2024 14:35:18 +0000 (15:35 +0100)] 
gh-123017: Add Android to the list of platforms where `strftime` doesn't support negative years (#124467)

Add Android to the list of platforms where `strftime` doesn't support negative years

13 months agogh-119180: No longer set `__annotations__` in `__main__` (#124634)
Jelle Zijlstra [Fri, 27 Sep 2024 12:49:43 +0000 (05:49 -0700)] 
gh-119180: No longer set `__annotations__` in `__main__` (#124634)

13 months agoGH-95079: document error behaviour for some unicode C APIs (#95080)
Max Bachmann [Fri, 27 Sep 2024 10:35:55 +0000 (12:35 +0200)] 
GH-95079: document error behaviour for some unicode C APIs (#95080)

13 months agoDocs: for for/else clarify that return or raise also skip the else (#124591)
Ned Batchelder [Fri, 27 Sep 2024 10:17:25 +0000 (06:17 -0400)] 
Docs: for for/else clarify that return or raise also skip the else (#124591)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
13 months agogh-124176: Add special support for dataclasses to `create_autospec` (#124429)
sobolevn [Fri, 27 Sep 2024 06:48:31 +0000 (09:48 +0300)] 
gh-124176: Add special support for dataclasses to `create_autospec` (#124429)

13 months agogh-86673: Harden `test_ttk.test_element_create_image` (#123335)
Erlend E. Aasland [Fri, 27 Sep 2024 06:21:15 +0000 (08:21 +0200)] 
gh-86673: Harden `test_ttk.test_element_create_image` (#123335)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
13 months agogenerate_global_objects.py: Fix name of macro in error message (#124464)
Jelle Zijlstra [Fri, 27 Sep 2024 04:37:21 +0000 (21:37 -0700)] 
generate_global_objects.py: Fix name of macro in error message (#124464)

_PyID does not exist but _Py_ID does.

13 months agogh-116510: Fix crash during sub-interpreter shutdown (gh-124645)
Neil Schemenauer [Fri, 27 Sep 2024 02:33:07 +0000 (19:33 -0700)] 
gh-116510: Fix crash during sub-interpreter shutdown (gh-124645)

Fix a bug that can cause a crash when sub-interpreters use "basic"
single-phase extension modules.  Shared objects could refer to PyGC_Head
nodes that had been freed as part of interpreter shutdown.

13 months agogh-116510: Fix crash due to shared immortal interned strings. (gh-124646)
Neil Schemenauer [Fri, 27 Sep 2024 02:16:51 +0000 (19:16 -0700)] 
gh-116510: Fix crash due to shared immortal interned strings. (gh-124646)

13 months agoGH-123516: Improve JIT memory consumption by invalidating cold executors (GH-124443)
Savannah Ostrowski [Fri, 27 Sep 2024 00:35:42 +0000 (17:35 -0700)] 
GH-123516: Improve JIT memory consumption by invalidating cold executors (GH-124443)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
13 months agoDocs: Update and proofread `library/venv.rst` (#124121)
Hugo van Kemenade [Thu, 26 Sep 2024 23:57:38 +0000 (16:57 -0700)] 
Docs: Update and proofread `library/venv.rst` (#124121)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
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-84559: Change the multiprocessing start method default to `forkserver` (GH-101556)
Gregory P. Smith [Thu, 26 Sep 2024 23:57:19 +0000 (16:57 -0700)] 
gh-84559: Change the multiprocessing start method default to `forkserver` (GH-101556)

Change the default multiprocessing start method away from fork to forkserver or spawn on the remaining platforms where it was fork.  See the issue for context.  This makes the default far more thread safe (other than for people spawning threads at import time... - don't do that!).

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
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)