Commit Graph

29989 Commits

Author SHA1 Message Date
Peter Bierma 01415213d7
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>
2024-10-31 17:14:37 +03:00
Sergey B Kirpichev 8c22eba877
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.
2024-10-31 11:37:03 +01:00
Nico-Posada d07dcce693
gh-126083: Fix a reference leak in `asyncio.Task` when reinitializing with new non-`None` context (#126103) 2024-10-31 10:47:57 +03:00
Barney Gale 951cb2c369
GH-126205: Fix conversion of UNC paths to file URIs (#126208)
File URIs for Windows UNC paths should begin with two slashes, not four.
2024-10-30 22:56:58 +00:00
Johan Förberg 2b2d607095
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>
2024-10-30 15:08:30 -07:00
Steve Dower 60c415bd53
gh-125315: Avoid crashing in _wmimodule due to slow WMI calls on some Windows machines (GH-126141) 2024-10-30 19:59:51 +00:00
Savannah Ostrowski c29bbe2101
GH-125498: Update JIT builds to use LLVM 19 and preserve_none (GH-125499) 2024-10-30 12:03:31 -07:00
Furkan Onder 4f826214b3
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>
2024-10-30 11:20:02 -07:00
Serhiy Storchaka cc9a183993
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.
2024-10-30 18:14:27 +02:00
sobolevn 1f16df4bfe
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.
2024-10-30 17:14:22 +03:00
Sergey B Kirpichev dcad8fecbd
gh-125206: Correct detection of complex numbers support in libffi (#126104) 2024-10-30 10:12:39 +01:00
Xuanteng Huang 35df4eb959
gh-126072: do not add `None` to `co_consts` if there is no docstring (GH-126101) 2024-10-30 09:01:09 +00:00
Pablo Galindo Salgado 2d37c719ed
gh-124855: Don't allow the JIT and perf support to be active at the same time (#124856) 2024-10-30 00:12:45 +00:00
Brian Schubert 224c370a36
gh-126139: Improve error message location for future statement with unknown feature (#126140) 2024-10-29 23:57:59 +00:00
Pablo Galindo Salgado 9dfef4e5f4
gh-125588: Teach the python PEG generator the new f-string tokens (#125589)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2024-10-29 23:40:12 +00:00
Hood Chatham b1f13bce62
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.
2024-10-30 05:45:49 +08:00
Christian Ullrich 802d405ff1
gh-126084: Fix venvwlauncher.exe to run pythonw.exe (GH-126088) 2024-10-29 19:52:52 +00:00
Tomas R. aab58a93ef
gh-118423: Add `INSTRUCTION_SIZE` macro to code generator (GH-125467) 2024-10-29 17:25:05 +00:00
sobolevn b2eaa75b17
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).
2024-10-29 17:42:48 +02:00
Mark Shannon faa3272fb8
GH-125837: Split `LOAD_CONST` into three. (GH-125972)
* Add LOAD_CONST_IMMORTAL opcode

* Add LOAD_SMALL_INT opcode

* Remove RETURN_CONST opcode
2024-10-29 11:15:42 +00:00
sobolevn a64a1c9206
gh-126106: Fix `NULL` possible derefrence in `Modules/_ssl.c` (#126111)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-10-29 12:03:18 +03:00
Hood Chatham dc2552d429
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.
2024-10-29 06:28:54 +00:00
Hugo van Kemenade dcda92f8fc
Pre-commit: prevent spaces in news entry paths (#126063) 2024-10-28 23:04:10 +02:00
Bénédikt Tran ed5059eeb1
gh-125966: fix use-after-free on `fut->fut_callback0` due to an evil callback's `__eq__` in asyncio (#125967) 2024-10-27 22:40:10 +05:30
Tomas R. 0922a4ae0d
gh-124295: Add translation tests for argparse (GH-124803) 2024-10-27 18:52:31 +02:00
Bénédikt Tran f819d4301d
gh-125984: fix use-after-free on `fut->fut_{callback,context}0` due to an evil `loop.__getattribute__` (#126003) 2024-10-27 20:34:43 +05:30
devdanzin 80eec52fc8
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>
2024-10-27 07:41:42 -07:00
Brian Schubert dc76a4ad3c
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>
2024-10-27 13:36:03 +03:00
Zhikang Yan dad3453129
gh-125633: Add function `ispackage` to stdlib `inspect` (#125634)
---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2024-10-27 14:57:43 +10:00
devdanzin 44becb8cba
gh-125666: Avoid PyREPL exiting when a null byte is in input (#125732) 2024-10-27 01:23:53 +00:00
Bogdan Romanyuk 51b012b2a8
gh-125593: Use colors to highlight error locations in tracebacks from exception group (#125681) 2024-10-27 01:57:10 +01:00
Erlend E. Aasland 26d627779f
gh-89640: properly detect float word ordering on Linux (#125571)
autoconf-archive patch by Dan Amelang.
2024-10-26 15:46:46 +00:00
Bénédikt Tran c5b99f5c2c
gh-125969: fix OOB in `future_schedule_callbacks` due to an evil `call_soon` (#125970)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2024-10-25 23:45:09 +05:30
Kumar Aditya cae853e3b4
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.
2024-10-25 18:19:30 +05:30
Victor Stinner db96327203
gh-121654: Add PyType_Freeze() function (#122457)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-10-25 11:12:48 +02:00
Malcolm Smith 371c537dff
Increase minimum Android API level to 24 (#125946)
Minimum Android API level has been increased to 24 (Android 7.0).
2024-10-25 08:41:07 +08:00
Malcolm Smith b08570c90e
gh-125942: Android: set stdout to `errors="backslashreplace"` (#125943)
Android stdout/err streams now use `backslashreplace` encoding to ensure readability of the Android log.
2024-10-25 08:35:41 +08:00
Malcolm Smith e68d4b08ff
gh-125940: Android: support 16 KB pages (#125941)
Modify Android build tooling to use 16kB pages.
2024-10-25 07:51:16 +08:00
Sam Gross fed501d724
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.
2024-10-24 18:12:51 -04:00
Shantanu 500f5338a8
gh-123930: Better error for "from imports" when script shadows module (#123929) 2024-10-24 12:11:12 -07:00
Javad Shafique 3f24bde0b6
gh-118950: Fix SSLProtocol.connection_lost not being called when OSError is thrown (#118960)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-10-24 17:41:16 +00:00
Sam Gross ad6110a93f
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.
2024-10-24 12:03:50 -04:00
Sam Gross e545ead66c
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.
2024-10-24 09:33:11 -04:00
Mark Shannon b61fece852
GH-125868: Fix STORE_ATTR_WITH_HINT specialization (GH-125876) 2024-10-24 11:57:02 +01:00
Jelle Zijlstra d3be6f945a
gh-125614: annotationlib: Fix bug where not all Stringifiers are converted (#125635) 2024-10-23 16:27:55 -07:00
Tian Gao 8f2c0f7a03
gh-125884: Support breakpoint on functions with annotations (#125892) 2024-10-23 18:04:30 -04:00
Serhiy Storchaka 834ba5aaf2
gh-58032: Deprecate the argparse.FileType type converter (GH-124664) 2024-10-23 10:50:29 +03:00
Jacob Walls c75ff2ef8e
gh-80958: unittest: discovery support for namespace packages as start directory (#123820) 2024-10-23 13:41:33 +09:00
Mario Šaško 34653bba64
gh-125259: Fix error notes removal in enum initialization (GH-125647) 2024-10-22 13:42:22 -07:00
Ethan Furman aaed91cabc
gh-125710: [Enum] fix hashable<->nonhashable comparisons for member values (GH-125735) 2024-10-22 11:04:00 -07:00