Commit Graph

125119 Commits

Author SHA1 Message Date
5ec1cff dda02eb7be
GH-128131: Completely support random read access of uncompressed unencrypted files in ZipFile (#128143)
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>
2025-01-20 13:04:43 -05:00
Thomas Grainger ed6934e71e
gh-128588: gh-128550: remove eager tasks optimization that missed and introduced incorrect cancellations (#129063)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-01-20 17:13:01 +00:00
Mark Shannon ab61d3f430
GH-128914: Remove conditional stack effects from `bytecodes.c` and the code generators (GH-128918) 2025-01-20 17:09:23 +00:00
Filipe Laíns 🇵🇸 0a6412f9cc
GH-129064: deprecate sysconfig.expand_makefile_vars (#129082) 2025-01-20 17:03:44 +00:00
Thomas Grainger 38a9956876
gh-128308: pass `**kwargs` to asyncio task_factory (#128768)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-01-20 22:23:55 +05:30
Diego Russo 6c914bf85c
Move to public Linux arm64 hosted runners (#128964)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-01-20 18:51:09 +02:00
Peter Bierma 6e02096e2f
gh-118915: C API: Document compiler flag macros (GH-129028) 2025-01-20 17:45:08 +01:00
Peter Bierma e792f4bc2e
Docs C API: Clarify what happens when null bytes are passed to `PyUnicode_AsUTF8` (#127458)
Co-authored-by: Stan U. <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-01-20 16:54:29 +01:00
Mark Shannon f0f7b978be
GH-128939: Refactor JIT optimize structs (GH-128940) 2025-01-20 15:49:15 +00:00
nikalinov e1fa2fcc7c
gh-129044: Update glossary entry for 'loader' to reflect current import system (#129073)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-01-20 15:46:09 +00:00
Victor Stinner 8ceb6cb117
gh-129033: Remove _PyInterpreterState_SetConfig() function (#129048)
Remove _PyInterpreterState_GetConfigCopy() and
_PyInterpreterState_SetConfig() private functions. PEP 741 "Python
Configuration C API" added a better public C API: PyConfig_Get() and
PyConfig_Set().
2025-01-20 16:31:33 +01:00
Victor Stinner 573c181502
Add Configuration Options table to PyInitConfig API doc (#129062)
Document PyConfig members:

* dump_refs_file
* stdlib_dir
* use_frozen_modules
* _pystats
2025-01-20 15:46:45 +01:00
Serhiy Storchaka 38c3cf6320
gh-71339: Use new assertion methods in test_ctypes (GH-129054) 2025-01-20 13:30:00 +00:00
Bénédikt Tran df66ff14b4
gh-128978: Fix a `NameError` in `sysconfig.expand_makefile_vars` (#128979)
This fixes a regression introduced by 4a53a397c3.
2025-01-20 13:27:14 +00:00
Bénédikt Tran 59fcae793f
Remove duplicated dict keys in `test_{embed,long}.py` fixtures (#128727) 2025-01-20 13:50:10 +01:00
Erlend E. Aasland da0f47ceab
gh-111178: Regen clinic and fix exceptions.c post gh-128447 (#129060) 2025-01-20 12:46:30 +00:00
Serhiy Storchaka a30277a06a
gh-71339: Use new assertion methods in test_capi (GH-129053) 2025-01-20 14:32:27 +02:00
Erlend E. Aasland 537296cdcd
gh-111178: Generate correct signature for most self converters (#128447) 2025-01-20 12:40:18 +01:00
Peter Bierma 4d0a6595a0
gh-128360: Add `_Py_AssertHoldsTstate` as assertion for holding a thread state (#128361)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-01-20 17:04:35 +05:30
Serhiy Storchaka c6b570e5e3
gh-71339: Use new assertion methods in `test_asyncio` (#129051) 2025-01-20 17:02:39 +05:30
Hugo van Kemenade 6f167d7134
gh-128595: Default to stdout isatty for colour detection instead of stderr (#128498)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-01-20 12:52:42 +02:00
Victor Stinner a429159797
Reorganize the PyInitConfig documentation (#129047)
Document the new PyInitConfig API before the old PyConfig API.
2025-01-20 11:42:04 +01:00
Tomas R. 9b1c1817af
Fix a typo in `syslog`'s error message (#129029) 2025-01-20 10:11:08 +00:00
Victor Stinner 07c3518ffb
gh-129033: Remove _Py_InitializeMain() function (#129034)
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2025-01-20 10:03:22 +00:00
Serhiy Storchaka c463270c73
gh-71339: Use new assertion methods in test_traceback (GH-128848) 2025-01-20 11:22:33 +02:00
Serhiy Storchaka 485d2e831e
gh-71339: Use assertIsSubclass() and assertNotIsSubclass() in test_decimal (GH-128827) 2025-01-20 11:20:49 +02:00
Serhiy Storchaka 36aaf4137d
gh-71339: Use new assertion methods in test_abc (GH-128826) 2025-01-20 11:19:43 +02:00
Serhiy Storchaka da122b5fac
gh-71339: Improve error report for types in assertHasAttr() and assertNotHasAttr() (GH-128818) 2025-01-20 11:17:49 +02:00
Serhiy Storchaka 89c401fb9a
gh-71339: Use new assertion methods in test_functools (GH-128829) 2025-01-20 11:17:04 +02:00
Serhiy Storchaka 887f2bcf48
gh-71339: Use assertIsSubclass() and assertNotIsSubclass() in test_collections (GH-128824) 2025-01-20 11:16:32 +02:00
Adam Turner 4967fa6a9c
GH-125722: Use long options for Sphinx (#129039) 2025-01-20 08:11:22 +02:00
Adam Turner d46b577ec0
GH-125722: Increase minimum supported Sphinx to 8.1.3 (#128922) 2025-01-20 00:26:24 +00:00
Tomas R. bca35f0e78
gh-129020: Remove ambiguous sentence from `tokenize.untokenize` docs (#129021) 2025-01-20 00:05:22 +00:00
Eli Schwartz 3b6a27c560
gh-118761: Redudce the import time of ``optparse`` (#128899)
The same change was made, and for the same reason, by ``argparse`` back in
2017. The ``textwrap`` module is only used when printing help text, so most
invocations will never need it imported.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-01-20 00:03:19 +00:00
Eli Schwartz c9c9fcb8fc
gh-118761: Improve the import time of ``gettext`` (#128898)
``gettext`` is often imported in programs that may not end up translating
anything. In fact, the ``struct`` module already has a delayed import when
parsing ``GNUTranslations`` to speed up the no ``.mo`` files case. The re module
is also used in the same situation, but behind a function chain only
called by ``GNUTranslations``.

Cache the compiled regex globally the first time it is used. The
finditer function is converted to a method call on the compiled
object which is slightly more efficient, and necessary for the
delayed re import.
2025-01-20 00:01:20 +00:00
Victor Stinner bbeb219354
Complete doc of pending C API removals in Python 3.15 (#129032) 2025-01-19 22:47:05 +01:00
Victor Stinner d57b2d83dd
gh-77782: Postpone Py_VerboseFlag removal to Python 3.15 (#129024)
Postpone the global configuration variables removal to Python 3.15.
Do the same for PySys_SetArgvEx(), PySys_SetArgv(),
Py_SetProgramName() and Py_SetPythonHome().
2025-01-19 20:51:17 +01:00
Kirill Podoprigora 6c52ada551
gh-100239: Handle NaN and zero division in guards for `BINARY_OP_EXTEND` (#128963)
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2025-01-19 11:02:49 +00:00
Mike Edmunds 5aaf416858
gh-80222: Fix email address header folding with long quoted-string (#122753)
Email generators using email.policy.default could incorrectly omit the
quote ('"') characters from a quoted-string during header refolding,
leading to invalid address headers and enabling header spoofing. This
change restores the quote characters on a bare-quoted-string as the
header is refolded, and escapes backslash and quote chars in the string.
2025-01-18 19:50:52 -05:00
Tian Gao 61b35f74aa
gh-128991: Release the enter frame reference within bdb callback (#128992)
* Release the enter frame reference within bdb callback

* 📜🤖 Added by blurb_it.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2025-01-18 16:53:06 -05:00
Rafael Fontenelle e8092e5cdc
gh-128998: Fix indentation of numbered list and literal block (#128999)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-01-18 20:52:30 +00:00
Peter Bierma fba475ae6f
gh-121542: Document trailing newline behavior in `set_content()` (#121543)
Co-authored-by: Yizheng Meng <dev@rapidcow.org>
2025-01-18 20:34:40 +02:00
Peter Bierma 3de7cc15c2
Pre-commit: Drop specific language version and bump hooks (#128801) 2025-01-18 19:53:17 +02:00
Victor Stinner 9bc19643ed
gh-128679: Skip test_tracemalloc_track_race() on debug build (#128988)
There is a race condition between PyMem_SetAllocator() and
PyMem_RawMalloc()/PyMem_RawFree(). While PyMem_SetAllocator() write
is protected by a lock, PyMem_RawMalloc()/PyMem_RawFree() reads are
not protected by a lock. PyMem_RawMalloc()/PyMem_RawFree() can be
called with an old context and the new function pointer.

On a release build, it's not an issue since the context is not used.
On a debug build, the debug hooks use the context and so can crash.
2025-01-18 15:13:54 +00:00
Victor Stinner 81159fce36
gh-59705: Make PYTHREAD_NAME_MAXLEN macro private (#128945)
Rename PYTHREAD_NAME_MAXLEN to _PYTHREAD_NAME_MAXLEN.
2025-01-18 15:10:29 +00:00
Bénédikt Tran f4afaa6f11
gh-125997: suggest efficient alternatives for `time.sleep(0)` (#128752) 2025-01-18 12:02:43 +01:00
Bénédikt Tran d5e9aa690a
gh-118761: Improve import time for `csv` (#128858)
This reduces the import time of the `csv` module by up to five times,
by importing `re` on demand.

In particular, the `re` module is no more implicitly exposed as `csv.re`.
2025-01-18 11:45:18 +01:00
Marie Roald d3adf02c90
gh-126349: Add 'fill', 'poly', and 'no_animation' context managers to turtle (#126350)
Co-authored-by: Marie Roald <roald.marie@gmail.com>
Co-authored-by: Yngve Mardal Moe <yngve.m.moe@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Daniel Hollas <danekhollas@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2025-01-18 11:27:22 +01:00
Tomasz Pytel 4dade055f4
gh-128961: Fix exhausted array iterator crash in __setstate__() (#128962) 2025-01-18 10:55:29 +01:00
Zanie Blue 9ed7bf2cd7
gh-128515: Add BOLT build to CI (gh-128845) 2025-01-18 07:32:23 +00:00