]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
12 months agoGH-125413: Add `pathlib.Path.scandir()` method (#126060)
Barney Gale [Fri, 1 Nov 2024 01:19:01 +0000 (01:19 +0000)] 
GH-125413: Add `pathlib.Path.scandir()` method (#126060)

Add `pathlib.Path.scandir()` as a trivial wrapper of `os.scandir()`. This
will be used to implement several `PathBase` methods more efficiently,
including methods that provide `Path.copy()`.

12 months agogh-126256: Update time.rst to use the same clock as instead of the same clock than...
Alperen Keleş [Thu, 31 Oct 2024 21:44:34 +0000 (17:44 -0400)] 
gh-126256: Update time.rst to use the same clock as instead of the same clock than (#126257)

Update time.rst to use `the same clock as` instead of `the same clock than`

The time documentation uses the same clock than time.monotonic instead of the same clock as time.monotonic, which is grammatically false. This PR fixes changes two instances of `the same clock than` to `the same clock as`.

12 months agogh-126156: Improve performance of creating `Morsel` objects (#126157)
J. Nick Koston [Thu, 31 Oct 2024 19:05:40 +0000 (14:05 -0500)] 
gh-126156: Improve performance of creating `Morsel` objects (#126157)

Replaces the manually constructed loop with a call to `dict.update`

12 months agogh-126080: fix UAF on `task->task_context` in `task_call_step_soon` due to an evil...
Bénédikt Tran [Thu, 31 Oct 2024 17:14:47 +0000 (18:14 +0100)] 
gh-126080: fix UAF on `task->task_context` in `task_call_step_soon` due to an evil `loop.__getattribute__` (#126120)

12 months agogh-101123: Adapt vararg functions in the math module to Argument Clinic (#126235)
Sergey B Kirpichev [Thu, 31 Oct 2024 14:37:47 +0000 (17:37 +0300)] 
gh-101123: Adapt vararg functions in the math module to Argument Clinic (#126235)

This implicitly fixes the math.hypot signature, which was previously
incomprehensible to inspect.signature().

12 months agogh-126240: handle `NULL` returned by `_Py_asdl_expr_seq_new` (#126241)
Bénédikt Tran [Thu, 31 Oct 2024 14:24:07 +0000 (15:24 +0100)] 
gh-126240: handle `NULL` returned by  `_Py_asdl_expr_seq_new` (#126241)

check return value of `_Py_asdl_expr_seq_new`

12 months agogh-126223: Propagate unicode errors in `_interpreters.create()` (#126224)
Peter Bierma [Thu, 31 Oct 2024 14:14:37 +0000 (10:14 -0400)] 
gh-126223: Propagate unicode errors in `_interpreters.create()` (#126224)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
12 months agogh-90370: Argument Clinic: avoid temporary tuple creation for varargs (#126064)
Sergey B Kirpichev [Thu, 31 Oct 2024 10:37:03 +0000 (13:37 +0300)] 
gh-90370: Argument Clinic: avoid temporary tuple creation for varargs (#126064)

Avoid temporary tuple creation when all arguments either positional-only
or vararg.

Objects/setobject.c and Modules/gcmodule.c adapted. This fixes slight
performance regression for set methods, introduced by gh-115112.

12 months agogh-126083: Fix a reference leak in `asyncio.Task` when reinitializing with new non...
Nico-Posada [Thu, 31 Oct 2024 07:47:57 +0000 (03:47 -0400)] 
gh-126083: Fix a reference leak in `asyncio.Task` when reinitializing with new non-`None` context (#126103)

12 months agogh-125818: Fix incorrect signature of argument `skip_file_prefixes` in warnings docs...
RUANG (James Roy) [Thu, 31 Oct 2024 01:15:07 +0000 (09:15 +0800)] 
gh-125818: Fix incorrect signature of argument `skip_file_prefixes` in warnings docs (GH-125823)

Change documentation

12 months agogh-126178: NFC Separate Emscripten and WASI standard lib disables in configure (...
Hood Chatham [Thu, 31 Oct 2024 00:51:11 +0000 (01:51 +0100)] 
gh-126178: NFC Separate Emscripten and WASI standard lib disables in configure (#126179)

Separate the Emscripten and WASI stdlib configuration in configure.

12 months agoAdd myself to CODEOWNERS for WASM/emscripten and Android (#126210)
Russell Keith-Magee [Thu, 31 Oct 2024 00:12:37 +0000 (08:12 +0800)] 
Add myself to CODEOWNERS for WASM/emscripten and Android (#126210)

Add RKM to CODEOWNERS for WASM/emscripten and Android.

12 months agoGH-126205: Fix conversion of UNC paths to file URIs (#126208)
Barney Gale [Wed, 30 Oct 2024 22:56:58 +0000 (22:56 +0000)] 
GH-126205: Fix conversion of UNC paths to file URIs (#126208)

File URIs for Windows UNC paths should begin with two slashes, not four.

12 months agogh-121267: Improve performance of tarfile (#121267) (#121269)
Johan Förberg [Wed, 30 Oct 2024 22:08:30 +0000 (23:08 +0100)] 
gh-121267: Improve performance of tarfile (#121267) (#121269)

Tarfile in the default write mode spends much of its time resolving UIDs
into usernames and GIDs into group names. By caching these mappings, a
significant speedup can be achieved.

In my simple benchmark[1], this extra caching speeds up tarfile by 8x.

[1] https://gist.github.com/jforberg/86af759c796199740c31547ae828aef2

---------

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
12 months agogh-125674: Doc: Fix type of `newfunc` first parameter (GH-125675)
Richard Hansen [Wed, 30 Oct 2024 20:27:37 +0000 (16:27 -0400)] 
gh-125674: Doc: Fix type of `newfunc` first parameter (GH-125675)

* gh-125674: Doc: Fix type of `newfunc` first parameter

* fixup! gh-125674: Doc: Fix type of `newfunc` first parameter

---------

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
12 months agogh-114990: Add missing mixin methods in collections.abc's document (GH-114991)
AN Long [Wed, 30 Oct 2024 20:17:20 +0000 (04:17 +0800)] 
gh-114990: Add missing mixin methods in collections.abc's document (GH-114991)

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
12 months agogh-125315: Avoid crashing in _wmimodule due to slow WMI calls on some Windows machine...
Steve Dower [Wed, 30 Oct 2024 19:59:51 +0000 (19:59 +0000)] 
gh-125315: Avoid crashing in _wmimodule due to slow WMI calls on some Windows machines (GH-126141)

12 months agoGH-125498: Update JIT builds to use LLVM 19 and preserve_none (GH-125499)
Savannah Ostrowski [Wed, 30 Oct 2024 19:03:31 +0000 (12:03 -0700)] 
GH-125498: Update JIT builds to use LLVM 19 and preserve_none (GH-125499)

12 months agogh-126055: Add omitted command (in docs [os.walk]) for code to fulfill `shutil.rmtre...
Victor Wheeler [Wed, 30 Oct 2024 18:22:58 +0000 (12:22 -0600)] 
gh-126055:  Add omitted command (in docs [os.walk]) for code to fulfill `shutil.rmtree` algorithm (GH-126067)

* gh-126055:  Add omitted command (in docs [os.walk]) for code to fulfill `shutil.rmtree` algorithm.

Resolves #126055

* gh-126055:  Fix omitted code highlighting

12 months agogh-60712: Include the "object" type in the lists of documented types (GH-103036)
Furkan Onder [Wed, 30 Oct 2024 18:20:02 +0000 (21:20 +0300)] 
gh-60712: Include the "object" type in the lists of documented types (GH-103036)

* add test for the predefined object's attributes

* Include the "object" type in the lists of documented types

* remove 'or' from augment tuple

* 📜🤖 Added by blurb_it.

* Add cross-reference to news

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* Fix format for the function parameter

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* Add space

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* add reference for the 'object'

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* add reference for NotImplemented

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* Change ref:`string <textseq>`  as class:`str`

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* remove hyphen from `newly-created`

* Update Doc/reference/datamodel.rst

'dictionaries' to 'dict'

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* Update predefined attribute types in testPredefinedAttrs

* Change `universal type` as `top type`

* Don't mention about the top type

* Update the description of richcmpfuncs

* Update Doc/library/stdtypes.rst

Co-authored-by: Éric <merwok@netwok.org>
* Revert: Hierarchy Section in Data Model Documentation

* Revert to original explanations of __new__ and __init__ methods in datamodel.rst for improved clarity.

* Update Doc/reference/datamodel.rst

Co-authored-by: Éric <merwok@netwok.org>
* Remove blank line

Co-authored-by: Éric <merwok@netwok.org>
* Use ref:`str <textseq>` instead of :class:`str

Co-authored-by: Éric <merwok@netwok.org>
* Revert changes the description of Other Built-in Types in stdtypes.rst

* Update Doc/reference/datamodel.rst

Co-authored-by: Éric <merwok@netwok.org>
---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
12 months agoFix incorrect indentation in importlib.metadata.rst (GH-126189)
Rafael Fontenelle [Wed, 30 Oct 2024 17:46:09 +0000 (14:46 -0300)] 
Fix incorrect indentation in importlib.metadata.rst (GH-126189)

12 months agogh-85583: Add f-string index in tutorial/inputoutput.rst (GH-21681)
amaajemyfren [Wed, 30 Oct 2024 17:26:29 +0000 (20:26 +0300)] 
gh-85583: Add f-string index in tutorial/inputoutput.rst  (GH-21681)

* bpo-41411 fstring index in tutorial/inputoutput

To assist in searching for fstrings I have added an index

* Add newline

---------

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
12 months agogh-126068: Fix exceptions in the argparse module (GH-126069)
Serhiy Storchaka [Wed, 30 Oct 2024 16:14:27 +0000 (18:14 +0200)] 
gh-126068: Fix exceptions in the argparse module (GH-126069)

* Only error messages for ArgumentError and ArgumentTypeError are now
  translated.
* ArgumentError is now only used for command line errors, not for logical
  errors in the program.
* TypeError is now raised instead of ValueError for some logical errors.

12 months agogh-125669: Do not run `-ugui` tests by default on `make test` (#125730)
sobolevn [Wed, 30 Oct 2024 14:14:22 +0000 (17:14 +0300)] 
gh-125669: Do not run `-ugui` tests by default on `make test` (#125730)

Adds `make ci` target for use in CI and keeping `make test` for the local development.

12 months agogh-91962: Fix `hstrerror` detection issues on Solaris (GH-91963)
Jakub Kulík [Wed, 30 Oct 2024 12:19:44 +0000 (13:19 +0100)] 
gh-91962: Fix `hstrerror` detection issues on Solaris (GH-91963)

12 months agogh-125206: Correct detection of complex numbers support in libffi (#126104)
Sergey B Kirpichev [Wed, 30 Oct 2024 09:12:39 +0000 (12:12 +0300)] 
gh-125206: Correct detection of complex numbers support in libffi (#126104)

12 months agogh-126072: do not add `None` to `co_consts` if there is no docstring (GH-126101)
Xuanteng Huang [Wed, 30 Oct 2024 09:01:09 +0000 (17:01 +0800)] 
gh-126072: do not add `None` to `co_consts` if there is no docstring (GH-126101)

12 months agogh-126071: Improve formatting of the argparse documentation (GH-126073)
Serhiy Storchaka [Wed, 30 Oct 2024 08:50:12 +0000 (10:50 +0200)] 
gh-126071: Improve formatting of the argparse documentation (GH-126073)

* Use appropriate roles for ArgumentParser, Action, etc.
* Remove superfluous repeated links.
* Explicitly document signatures and add index entries for some methods
  and classes.
* Make it more clear that some parameters are keyword-only.
* Fix some minor errors.

12 months agogh-118633: Add warning regarding the unsafe usage of eval and exec (GH-118437)
Daniel Ruf [Wed, 30 Oct 2024 00:36:18 +0000 (01:36 +0100)] 
gh-118633: Add warning regarding the unsafe usage of eval and exec (GH-118437)

* Add warning regarding the unsafe usage of eval

* Add warning regarding the unsafe usage of exec

* Move warning under parameters table

* Use suggested shorter text

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Use suggested shorter text

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Improve wording as suggested

---------

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
12 months agogh-58032: Docs: Sort argparse alphabetically (GH-125871)
Hugo van Kemenade [Wed, 30 Oct 2024 00:13:11 +0000 (02:13 +0200)] 
gh-58032: Docs: Sort argparse alphabetically (GH-125871)

Sort argparse alphabetically

12 months agogh-124855: Don't allow the JIT and perf support to be active at the same time (#124856)
Pablo Galindo Salgado [Wed, 30 Oct 2024 00:12:45 +0000 (00:12 +0000)] 
gh-124855: Don't allow the JIT and perf support to be active at the same time (#124856)

12 months agodocs: restore an anchor to for/else (#126154)
Ned Batchelder [Wed, 30 Oct 2024 00:11:50 +0000 (20:11 -0400)] 
docs: restore an anchor to for/else (#126154)

12 months agogh-126139: Improve error message location for future statement with unknown feature...
Brian Schubert [Tue, 29 Oct 2024 23:57:59 +0000 (19:57 -0400)] 
gh-126139: Improve error message location for future statement with unknown feature (#126140)

12 months agogh-125588: Teach the python PEG generator the new f-string tokens (#125589)
Pablo Galindo Salgado [Tue, 29 Oct 2024 23:40:12 +0000 (23:40 +0000)] 
gh-125588: Teach the python PEG generator the new f-string tokens (#125589)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
12 months agoDoc: Note that pydoc uses and prefers ``MANPAGER`` (#125362)
Matthieu Ancellin [Tue, 29 Oct 2024 23:12:02 +0000 (00:12 +0100)] 
Doc: Note that pydoc uses and prefers ``MANPAGER`` (#125362)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
12 months agobpo-41793: Fix an inaccuracy about reflected methods in datamodel docs (GH-22257)
Wim Jeantine-Glenn [Tue, 29 Oct 2024 23:02:27 +0000 (18:02 -0500)] 
bpo-41793: Fix an inaccuracy about reflected methods in datamodel docs (GH-22257)

* Qualifying that the right operand's type must be a *strict* subclass for the reflected method to take precedence avoids an edge case / counter-example when the types are actually equal.

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
12 months agogh-116938: Fix `dict.update` docstring and remove erraneous full stop from `dict...
Prometheus3375 [Tue, 29 Oct 2024 23:00:04 +0000 (02:00 +0300)] 
gh-116938: Fix `dict.update` docstring and remove erraneous full stop from `dict` documentation (#125421)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
12 months agogh-126146: Remove ``__cmp__`` method from tests (#126147)
Kirill Podoprigora [Tue, 29 Oct 2024 22:47:26 +0000 (00:47 +0200)] 
gh-126146: Remove ``__cmp__`` method from tests (#126147)

Remove ``__cmp__`` method from the tests because it was removed in 3.0 version.

12 months agogh-124932: Distinguish build prefix from host prefix in cross builds (#124933)
Hood Chatham [Tue, 29 Oct 2024 21:45:49 +0000 (22:45 +0100)] 
gh-124932: Distinguish build prefix from host prefix in cross builds (#124933)

In Emscripten and other cross builds, the build file system and the host file
system look different. For instance, we may want to install into
`cross-build/$TARGET/lib`, and then mount that as `/lib` in the host file
system. This change adds a distinction between:

* `prefix` -- the path in the build file system where we want to install the files
* `host_prefix` -- the path in the host file system where getpath.c will look for the files

And similarly for `exec_prefix` and `host_exec_prefix`. At present, this is only
used for Emscripten.

12 months agoGH-125866: Improve tests for `pathname2url()` and `url2pathname()` (#125993)
Barney Gale [Tue, 29 Oct 2024 20:44:57 +0000 (20:44 +0000)] 
GH-125866: Improve tests for `pathname2url()` and `url2pathname()` (#125993)

Merge `URL2PathNameTests` and `PathName2URLTests` test cases (which test
only the Windows-specific implementations from `nturl2path`) into the main
`Pathname_Tests` test case for these functions.

Copy/port some test cases for `pathlib.Path.as_uri()` and `from_uri()`.

12 months agogh-126084: Fix venvwlauncher.exe to run pythonw.exe (GH-126088)
Christian Ullrich [Tue, 29 Oct 2024 19:52:52 +0000 (20:52 +0100)] 
gh-126084: Fix venvwlauncher.exe to run pythonw.exe (GH-126088)

12 months agoAdd lightweight comments to conf.py and update docs readme (GH-126100)
Carol Willing [Tue, 29 Oct 2024 17:45:03 +0000 (10:45 -0700)] 
Add lightweight comments to conf.py and update docs readme (GH-126100)

* Update contributing contact info in readme

* Add lightweight comments to improve docs workflow understanding

* Apply code review suggestions from @hugovk

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* Add code review suggestion from @AA-Turner

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Update Doc/conf.py

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Update Doc/conf.py

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Update Doc/conf.py

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
12 months agogh-118423: Add `INSTRUCTION_SIZE` macro to code generator (GH-125467)
Tomas R. [Tue, 29 Oct 2024 17:25:05 +0000 (18:25 +0100)] 
gh-118423: Add `INSTRUCTION_SIZE` macro to code generator (GH-125467)

12 months agogh-126105: Fix crash in `ast` module, when `._fields` is deleted (#126115)
sobolevn [Tue, 29 Oct 2024 15:42:48 +0000 (18:42 +0300)] 
gh-126105: Fix crash in `ast` module, when `._fields` is deleted (#126115)

Previously, if the `ast.AST._fields` attribute was deleted, attempts to create a new `as`t node would crash due to the assumption that `_fields` always had a non-NULL value. Now it has been fixed by adding an extra check to ensure that `_fields` does not have a NULL value (this can happen when you manually remove `_fields` attribute).

12 months agogh-122767: document "new style" formatting for complexes (GH-122848)
Sergey B Kirpichev [Tue, 29 Oct 2024 14:36:18 +0000 (17:36 +0300)] 
gh-122767: document "new style" formatting for complexes (GH-122848)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
12 months agoGH-125837: Split `LOAD_CONST` into three. (GH-125972)
Mark Shannon [Tue, 29 Oct 2024 11:15:42 +0000 (11:15 +0000)] 
GH-125837: Split `LOAD_CONST` into three. (GH-125972)

* Add LOAD_CONST_IMMORTAL opcode

* Add LOAD_SMALL_INT opcode

* Remove RETURN_CONST opcode

12 months agotomllib: Add a comment about implicit lru_cache bound (GH-126078)
Taneli Hukkinen [Tue, 29 Oct 2024 10:36:14 +0000 (12:36 +0200)] 
tomllib: Add a comment about implicit lru_cache bound (GH-126078)

12 months agogh-126106: Fix `NULL` possible derefrence in `Modules/_ssl.c` (#126111)
sobolevn [Tue, 29 Oct 2024 09:03:18 +0000 (12:03 +0300)] 
gh-126106: Fix `NULL` possible derefrence in `Modules/_ssl.c` (#126111)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
12 months agoAlign functools.reduce() docstring with PEP-257 (#126045)
Sergey B Kirpichev [Tue, 29 Oct 2024 08:08:08 +0000 (11:08 +0300)] 
Align functools.reduce() docstring with PEP-257 (#126045)

Yak-shave in preparation for Argument Clinic adaption in gh-125999.

12 months agogh-126014: Ignore `__pycache__`-only folders in makefile tests (#126066)
sobolevn [Tue, 29 Oct 2024 07:43:48 +0000 (10:43 +0300)] 
gh-126014: Ignore `__pycache__`-only folders in makefile tests (#126066)

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
12 months agogh-124928: Emscripten node support: Clean up old node <= 16 flags (#124929)
Hood Chatham [Tue, 29 Oct 2024 06:28:54 +0000 (07:28 +0100)] 
gh-124928: Emscripten node support: Clean up old node <= 16 flags (#124929)

Clean up configure flags for old node versions

These flags are only needed for node <= 16. Node 16 has been end of life since
October of 2023.

12 months agogh-89762: Document strftime %G, %V, and %u format specifiers (#124572)
RUANG (James Roy) [Mon, 28 Oct 2024 21:53:18 +0000 (05:53 +0800)] 
gh-89762: Document strftime %G, %V, and %u format specifiers (#124572)

12 months agogh-125985: Add free threading scaling micro benchmarks (#125986)
Sam Gross [Mon, 28 Oct 2024 21:47:23 +0000 (17:47 -0400)] 
gh-125985: Add free threading scaling micro benchmarks (#125986)

These consist of a number of short snippets that help identify scaling
bottlenecks in the free threaded interpreter.

The current bottlenecks are in calling functions in benchmarks that call
functions (due to `LOAD_ATTR` not yet using deferred reference counting)
and when accessing thread-local data.

12 months agoGH-125912: Teach the JIT's optimizer about _BINARY_OP_INPLACE_ADD_UNICODE (GH-125935)
Brandt Bucher [Mon, 28 Oct 2024 21:37:16 +0000 (14:37 -0700)] 
GH-125912: Teach the JIT's optimizer about _BINARY_OP_INPLACE_ADD_UNICODE (GH-125935)

12 months agoPre-commit: prevent spaces in news entry paths (#126063)
Hugo van Kemenade [Mon, 28 Oct 2024 21:04:10 +0000 (23:04 +0200)] 
Pre-commit: prevent spaces in news entry paths (#126063)

12 months agoLint GitHub Actions and Dependabot (#126002)
Hugo van Kemenade [Mon, 28 Oct 2024 18:59:35 +0000 (20:59 +0200)] 
Lint GitHub Actions and Dependabot (#126002)

12 months agogh-126081: For PRs labeled with "type-feature", require a core review (GH-126082)
Łukasz Langa [Mon, 28 Oct 2024 17:15:46 +0000 (18:15 +0100)] 
gh-126081: For PRs labeled with "type-feature", require a core review (GH-126082)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
12 months agoGH-125515: Reduce number of compiler warnings in generated code (GH-125697)
Mark Shannon [Mon, 28 Oct 2024 10:30:31 +0000 (10:30 +0000)] 
GH-125515: Reduce number of compiler warnings in generated code (GH-125697)

12 months agogh-126035: add missing whitespace to *Py_EnterRecursiveCall() messages (#126036)
Bénédikt Tran [Sun, 27 Oct 2024 21:55:48 +0000 (22:55 +0100)] 
gh-126035: add missing whitespace to *Py_EnterRecursiveCall() messages (#126036)

12 months agogh-124295: Skip translation tests when pygettext is missing (GH-126051)
Tomas R. [Sun, 27 Oct 2024 18:09:08 +0000 (19:09 +0100)] 
gh-124295: Skip translation tests when pygettext is missing (GH-126051)

12 months agogh-125966: fix use-after-free on `fut->fut_callback0` due to an evil callback's ...
Bénédikt Tran [Sun, 27 Oct 2024 17:10:10 +0000 (18:10 +0100)] 
gh-125966: fix use-after-free on `fut->fut_callback0` due to an evil callback's `__eq__` in asyncio (#125967)

12 months agogh-124295: Add translation tests for argparse (GH-124803)
Tomas R. [Sun, 27 Oct 2024 16:52:31 +0000 (17:52 +0100)] 
gh-124295: Add translation tests for argparse (GH-124803)

12 months agogh-125984: fix use-after-free on `fut->fut_{callback,context}0` due to an evil `loop...
Bénédikt Tran [Sun, 27 Oct 2024 15:04:43 +0000 (16:04 +0100)] 
gh-125984: fix use-after-free on `fut->fut_{callback,context}0` due to an evil `loop.__getattribute__` (#126003)

12 months agogh-126018: Avoid aborting due to unnecessary assert in `sys.audit` (#126020)
devdanzin [Sun, 27 Oct 2024 14:41:42 +0000 (11:41 -0300)] 
gh-126018: Avoid aborting due to unnecessary assert in `sys.audit` (#126020)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
12 months agogh-126012: Add `__class_getitem__` to `memoryview` (#126013)
Brian Schubert [Sun, 27 Oct 2024 10:36:03 +0000 (06:36 -0400)] 
gh-126012: Add `__class_getitem__` to `memoryview` (#126013)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
12 months agogh-125633: Add function `ispackage` to stdlib `inspect` (#125634)
Zhikang Yan [Sun, 27 Oct 2024 04:57:43 +0000 (12:57 +0800)] 
gh-125633: Add function `ispackage` to stdlib `inspect` (#125634)

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
12 months agoAndroid: Update tests for newly-available functions affected by SELinux (#126015)
Malcolm Smith [Sun, 27 Oct 2024 02:35:53 +0000 (02:35 +0000)] 
Android: Update tests for newly-available functions affected by SELinux (#126015)

Skip tests on Android that involve use of SELinux-protected methods.

12 months agogh-125666: Avoid PyREPL exiting when a null byte is in input (#125732)
devdanzin [Sun, 27 Oct 2024 01:23:53 +0000 (22:23 -0300)] 
gh-125666: Avoid PyREPL exiting when a null byte is in input (#125732)

12 months agogh-125593: Use colors to highlight error locations in tracebacks from exception group...
Bogdan Romanyuk [Sun, 27 Oct 2024 00:57:10 +0000 (03:57 +0300)] 
gh-125593: Use colors to highlight error locations in tracebacks from exception group (#125681)

12 months agogh-94512: Fix forced arg format in posixmodule.c clinic code (#122516)
Bénédikt Tran [Sat, 26 Oct 2024 21:40:31 +0000 (23:40 +0200)] 
gh-94512: Fix forced arg format in posixmodule.c clinic code (#122516)

12 months agogh-89640: properly detect float word ordering on Linux (#125571)
Erlend E. Aasland [Sat, 26 Oct 2024 15:46:46 +0000 (17:46 +0200)] 
gh-89640: properly detect float word ordering on Linux (#125571)

autoconf-archive patch by Dan Amelang.

12 months agoFix a typo in ``Doc/tutorial/errors.rst`` exception output (#126001)
Bogdana Vereha [Sat, 26 Oct 2024 15:26:35 +0000 (17:26 +0200)] 
Fix a typo in ``Doc/tutorial/errors.rst`` exception output (#126001)

12 months agoUpdate CODEOWNERS (#126005)
Guido van Rossum [Sat, 26 Oct 2024 15:24:51 +0000 (08:24 -0700)] 
Update CODEOWNERS (#126005)

12 months agogh-125698: Autoconf: Sync EXEEXT and ac_exeext (#125995)
Erlend E. Aasland [Sat, 26 Oct 2024 15:11:42 +0000 (17:11 +0200)] 
gh-125698: Autoconf: Sync EXEEXT and ac_exeext (#125995)

12 months agogh-125969: fix OOB in `future_schedule_callbacks` due to an evil `call_soon` (#125970) 125389/head
Bénédikt Tran [Fri, 25 Oct 2024 18:15:09 +0000 (20:15 +0200)] 
gh-125969: fix OOB in `future_schedule_callbacks` due to an evil `call_soon` (#125970)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
12 months agogh-125783: Add tests to prevent regressions with the combination of `ctypes` and...
Jun Komoda [Fri, 25 Oct 2024 16:31:35 +0000 (01:31 +0900)] 
gh-125783: Add tests to prevent regressions with the combination of `ctypes` and metaclasses. (GH-125881)

12 months agoGH-125911: Call combine_symbol_mask on the initial trampoline of a trace (GH-125973)
Nadeshiko Manju [Fri, 25 Oct 2024 15:43:02 +0000 (23:43 +0800)] 
GH-125911: Call combine_symbol_mask on the initial trampoline of a trace (GH-125973)

12 months agogh-120313: amend documentation regarding `ctypes._CFuncPtr` (GH-120989)
Bénédikt Tran [Fri, 25 Oct 2024 13:32:23 +0000 (15:32 +0200)] 
gh-120313: amend documentation regarding `ctypes._CFuncPtr` (GH-120989)

improve docs

12 months agoGH-125789: fix `fut._callbacks` to always return a copy of callbacks (#125922)
Kumar Aditya [Fri, 25 Oct 2024 12:49:30 +0000 (18:19 +0530)] 
GH-125789: fix `fut._callbacks` to always return a copy of callbacks (#125922)

Fix `asyncio.Future._callbacks` to always return a copy of the internal list of callbacks to avoid mutation from user code affecting the internal state.

12 months agogh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_STR) (#125583)
Victor Stinner [Fri, 25 Oct 2024 09:14:52 +0000 (11:14 +0200)] 
gh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_STR) (#125583)

Replace PyUnicode_FromStringAndSize(NULL, 0)
with Py_GetConstant(Py_CONSTANT_EMPTY_STR).

12 months agogh-121654: Add PyType_Freeze() function (#122457)
Victor Stinner [Fri, 25 Oct 2024 09:12:48 +0000 (11:12 +0200)] 
gh-121654: Add PyType_Freeze() function (#122457)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
12 months agogh-84545: Clarify the 'extend' action documentation in argparse (GH-125870)
Serhiy Storchaka [Fri, 25 Oct 2024 08:41:38 +0000 (11:41 +0300)] 
gh-84545: Clarify the 'extend' action documentation in argparse (GH-125870)

12 months agogh-123930: Correct test of attribute failure to account for iOS (#125959)
Russell Keith-Magee [Fri, 25 Oct 2024 07:18:45 +0000 (15:18 +0800)] 
gh-123930: Correct test of attribute failure to account for iOS (#125959)

Update a test of importing attributes from binary modules to account for iOS conditions.

12 months agoFixed a few type mismatches in pdb (#125952)
Tian Gao [Fri, 25 Oct 2024 04:17:58 +0000 (21:17 -0700)] 
Fixed a few type mismatches in pdb (#125952)

12 months agoIncrease minimum Android API level to 24 (#125946)
Malcolm Smith [Fri, 25 Oct 2024 00:41:07 +0000 (01:41 +0100)] 
Increase minimum Android API level to 24 (#125946)

Minimum Android API level has been increased to 24 (Android 7.0).

12 months agogh-125942: Android: set stdout to `errors="backslashreplace"` (#125943)
Malcolm Smith [Fri, 25 Oct 2024 00:35:41 +0000 (01:35 +0100)] 
gh-125942: Android: set stdout to `errors="backslashreplace"` (#125943)

Android stdout/err streams now use `backslashreplace` encoding to ensure readability of the Android log.

12 months agogh-125940: Android: support 16 KB pages (#125941)
Malcolm Smith [Thu, 24 Oct 2024 23:51:16 +0000 (00:51 +0100)] 
gh-125940: Android: support 16 KB pages (#125941)

Modify Android build tooling to use 16kB pages.

12 months agogh-125245: Fix race condition when importing `collections.abc` (#125415)
Sam Gross [Thu, 24 Oct 2024 22:12:51 +0000 (18:12 -0400)] 
gh-125245: Fix race condition when importing `collections.abc` (#125415)

If multiple threads concurrently imported `collections.abc`, some of the
threads might incorrectly see the "shim" `Lib/collections/abc.py` module
instead of the correct `Lib/_collections_abc.py` module.  This affected
both the free threading build and the default GIL-enabled build.

12 months agogh-125900: Clean-up logic around immortalization in free-threading (#125901)
Sam Gross [Thu, 24 Oct 2024 22:09:59 +0000 (18:09 -0400)] 
gh-125900: Clean-up logic around immortalization in free-threading (#125901)

* Remove `@suppress_immortalization` decorator
* Make suppression flag per-thread instead of per-interpreter
* Suppress immortalization in `eval()` to avoid refleaks in three tests
  (test_datetime.test_roundtrip, test_logging.test_config8_ok, and
   test_random.test_after_fork).
* frozenset() is constant, but not a singleton. When run multiple times,
  the test could fail due to constant interning.

12 months agogh-125933: Add ARIA labels to select elements in the version switcher (#125934)
Kerim Kabirov [Thu, 24 Oct 2024 20:52:21 +0000 (22:52 +0200)] 
gh-125933: Add ARIA labels to select elements in the version switcher (#125934)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
12 months agogh-123930: Better error for "from imports" when script shadows module (#123929)
Shantanu [Thu, 24 Oct 2024 19:11:12 +0000 (12:11 -0700)] 
gh-123930: Better error for "from imports" when script shadows module (#123929)

12 months agogh-118950: Fix SSLProtocol.connection_lost not being called when OSError is thrown...
Javad Shafique [Thu, 24 Oct 2024 17:41:16 +0000 (19:41 +0200)] 
gh-118950: Fix SSLProtocol.connection_lost not being called when OSError is thrown (#118960)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
12 months agogh-125864: Propagate `pickle.loads()` failures in `InterpreterPoolExecutor` (gh-125898)
Peter Bierma [Thu, 24 Oct 2024 16:51:45 +0000 (12:51 -0400)] 
gh-125864: Propagate `pickle.loads()` failures in `InterpreterPoolExecutor` (gh-125898)

Authored-by: Peter Bierma <zintensitydev@gmail.com>
12 months agogh-124218: Avoid refcount contention on builtins module (GH-125847)
Sam Gross [Thu, 24 Oct 2024 16:44:38 +0000 (12:44 -0400)] 
gh-124218: Avoid refcount contention on builtins module (GH-125847)

This replaces `_PyEval_BuiltinsFromGlobals` with
`_PyDict_LoadBuiltinsFromGlobals`, which returns a new reference
instead of a borrowed reference. Internally, the new function uses
per-thread reference counting when possible to avoid contention on the
refcount fields on the builtins module.

12 months agogh-125909: Avoid a redirect when linking to the devguide (#125826)
partev [Thu, 24 Oct 2024 16:41:01 +0000 (12:41 -0400)] 
gh-125909: Avoid a redirect when linking to the devguide (#125826)

12 months agogh-125842: Fix `sys.exit(0xffff_ffff)` on Windows (#125896)
Sam Gross [Thu, 24 Oct 2024 16:03:50 +0000 (12:03 -0400)] 
gh-125842: Fix `sys.exit(0xffff_ffff)` on Windows (#125896)

On Windows, `long` is a signed 32-bit integer so it can't represent
`0xffff_ffff` without overflow. Windows exit codes are unsigned 32-bit
integers, so if a child process exits with `-1`, it will be represented
as `0xffff_ffff`.

Also fix a number of other possible cases where `_Py_HandleSystemExit`
could return with an exception set, leading to a `SystemError` (or
fatal error in debug builds) later on during shutdown.

12 months agogh-125859: Fix crash when `gc.get_objects` is called during GC (#125882)
Sam Gross [Thu, 24 Oct 2024 13:33:11 +0000 (09:33 -0400)] 
gh-125859: Fix crash when `gc.get_objects` is called during GC (#125882)

This fixes a crash when `gc.get_objects()` or `gc.get_referrers()` is
called during a GC in the free threading build.

Switch to `_PyObjectStack` to avoid corrupting the `struct worklist`
linked list maintained by the GC. Also, don't return objects that are frozen
(`gc.freeze()`) or in the process of being collected to more closely match
the behavior of the default build.

12 months agoGH-125868: Fix STORE_ATTR_WITH_HINT specialization (GH-125876)
Mark Shannon [Thu, 24 Oct 2024 10:57:02 +0000 (11:57 +0100)] 
GH-125868: Fix STORE_ATTR_WITH_HINT specialization (GH-125876)

12 months agoFix typo in garbage_collector.md (#125556)
Marat Sharafutdinov [Thu, 24 Oct 2024 02:04:49 +0000 (05:04 +0300)] 
Fix typo in garbage_collector.md (#125556)

12 months agogh-125614: annotationlib: Fix bug where not all Stringifiers are converted (#125635)
Jelle Zijlstra [Wed, 23 Oct 2024 23:27:55 +0000 (16:27 -0700)] 
gh-125614: annotationlib: Fix bug where not all Stringifiers are converted (#125635)