Commit graph

56624 commits

Author SHA1 Message Date
Victor Stinner
2cd0ddfe04
gh-141510: Fix frozendict.items() ^ frozendict.items() (#145535)
Add non-regression tests.
2026-03-05 14:14:04 +01:00
Victor Stinner
7bdfce0d3a
gh-145056: Accept frozendict in xml.etree (#145508)
Element and SubElement of xml.etree.ElementTree now also accept
frozendict for attrib.

Export _PyDict_CopyAsDict() function.
2026-03-05 12:55:28 +01:00
Victor Stinner
c0ecf211b2
gh-145055: Accept frozendict for globals in exec() and eval() (#145072) 2026-03-05 12:35:43 +01:00
Victor Stinner
c8aa8de9a5
gh-141510: Use frozendict in the _opcode_metadata (#144910)
Enhance py_metadata_generator.py to skip duplicates.

Co-authored-by: Donghee Na <donghee.na@python.org>
2026-03-05 12:33:13 +01:00
Victor Stinner
0fe20fc170
gh-141510: Don't accept frozendict in PyDict_Watch() (#145529)
Don't accept frozendict in PyDict_Watch() and PyDict_Unwatch().
A frozendict cannot be modified, so it's not useful to watch for
modifications.
2026-03-05 12:31:29 +01:00
Hood Chatham
23a4e3ba3c
gh-145335: Skip Emscripten for os.execve() test (#145528)
Emscripten's os.execve() always fails with ENOEXEC.

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-05 12:29:34 +01:00
Victor Stinner
72b3e374a3
gh-141510: Add frozendict support to python-gdb.py (#145511) 2026-03-05 00:57:54 +01:00
Stan Ulbrych
ae208d5665
Fix bugs in compute-changes.py logic for CIFuzz (#145232) 2026-03-04 22:43:44 +02:00
Steve Dower
a51b1b512d
gh-145506: Fixes CVE-2026-2297 by ensuring SourcelessFileLoader uses io.open_code (GH-145507) 2026-03-04 19:55:52 +00:00
Victor Stinner
95f56b1206
gh-141510: Return frozendict unmodified in PyDict_Copy() (#145505)
Add also the internal _PyDict_CopyAsDict() function.
2026-03-04 19:11:00 +00:00
Itamar Oren
6cdbd7bc5d
gh-122941: Fix test_launcher sporadic failures via py.ini isolation (GH-145090)
Adds _PYLAUNCHER_INIDIR as a private variable since the launcher is deprecated and not getting new features.
2026-03-04 18:06:49 +00:00
Miro Hrončok
45e9343d7e
GH-144739: Skip test_pyexpat.MemoryProtectionTest based on expat compile-time version, not runtime (#144740) 2026-03-04 13:59:50 +01:00
Victor Stinner
31343cf2bc
gh-142417: Restore private _Py_InitializeMain() function (#145472)
This reverts commit 07c3518ffb.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-03-04 11:00:08 +01:00
Tan Long
745947cda0
gh-135883: Fix sqlite3 CLI history scrolling with colored prompts (#135884) 2026-03-03 19:48:03 +01:00
Bartosz Sławecki
e6c3c04fab
gh-145452: Initialize PyLazyImport_Type during interpreter startup (#145453)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-03 17:14:12 +01:00
bkap123
671a953dd6
gh-144475: Fix reference management in partial_repr (GH-145362) 2026-03-03 13:46:02 +00:00
Victor Stinner
52c8efa87d
gh-145335: Fix os functions when passing fd -1 as path (#145439)
os.listdir(-1) and os.scandir(-1) now fail with OSError(errno.EBADF)
rather than listing the current directory.

os.listxattr(-1) now fails with OSError(errno.EBADF) rather than
listing extended attributes of the current directory.
2026-03-03 13:57:08 +01:00
Victor Stinner
c9d123482a
gh-144995: Optimize memoryview == memoryview (#144996)
Optimize memoryview comparison: a memoryview is equal to itself, there is no
need to compare values, except if it uses float format.

Benchmark comparing 1 MiB:

    from timeit import timeit
    with open("/dev/random", 'br') as fp:
        data = fp.read(2**20)
    view = memoryview(data)
    LOOPS = 1_000
    b = timeit('x == x', number=LOOPS, globals={'x': data})
    m = timeit('x == x', number=LOOPS, globals={'x': view})
    print("bytes %f seconds" % b)
    print("mview %f seconds" % m)
    print("=> %f time slower" % (m / b))

Result before the change:

    bytes 0.000026 seconds
    mview 1.445791 seconds
    => 55660.873940 time slower

Result after the change:

    bytes 0.000026 seconds
    mview 0.000028 seconds
    => 1.104382 time slower

This missed optimization was discovered by Pierre-Yves David
while working on Mercurial.

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
2026-03-03 12:15:32 +01:00
Daniel Hollas
ea90b032a0
gh-117865: Speedup import of inspect module (#144756)
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
2026-03-02 23:39:07 +02:00
Filipe Laíns
f739e2ca62
Add sysconfig[VPATH] to test.pythoninfo (#145434) 2026-03-02 20:48:07 +00:00
Stan Ulbrych
f8d2f9fe67
gh-145118: Add frozendict support to type() (#145124) 2026-03-02 20:45:03 +01:00
Peter Bierma
592e8f0865
gh-130327: Always traverse managed dictionaries, even when inline values are available (#130469) 2026-03-02 14:32:06 -05:00
Filipe Laíns
3ab39d2308
GH-145273: warn when we can't find the standard library (#145274) 2026-03-02 18:51:45 +00:00
AN Long
5c3a47b94a
gh-145335: Fix crash when passing -1 as fd in os.pathconf (#145390)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-03-02 19:07:49 +01:00
Sam Gross
02288bf022
gh-130555: Fix use-after-free in dict.clear() with embedded values (gh-145268) 2026-03-02 12:25:13 -05:00
Steve Dower
1cf5abedeb
gh-145307: Defer loading psapi.dll until ctypes.util.dllist() is called. (GH-145308) 2026-03-02 17:10:15 +01:00
Thomas A Caswell
201d251567
DOC: clarify and expand documentation about PYTHONUSERBASE and PYTHONNOUSERSITE (#144637) 2026-03-02 15:54:26 +00:00
zhong
b611db491d
gh-142781: Fix type confusion in zoneinfo weak cache (GH-142925)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-03-02 13:30:38 +01:00
Facundo Batista
e542255458
gh-144835: Added missing explanations for some parameters in glob and iglob. (#144836)
* Added missing explanations for some parameters in glob and iglob.

* News entry.

* Added proper 'func' indication in News file.

* Consistent use of backticks.

* Improved wording.

* consistent wording between the two docstrings

---------

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2026-03-02 08:56:28 -03:00
Bartosz Sławecki
8bcb3eaa67
gh-144851: Fix __lazy_import__ crash with user-defined filters (#144852) 2026-03-02 12:01:32 +01:00
Petr Viktorin
3b276f3f59
gh-144748: Make PyErr_CheckSignals raise the exception scheduled by PyThreadState_SetAsyncExc (GH-145178)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2026-03-02 11:47:32 +01:00
Furkan Onder
41fa2dbc0e
gh-137829: Fix shelve tests for backend compatibility (#137879) 2026-03-01 16:48:13 +01:00
Jelle Zijlstra
3484ef6003
gh-145033: Implement PEP 747 (#145034) 2026-02-28 19:52:04 -08:00
Maksym Kasimov
0598f4a899
gh-142352: Fix asyncio start_tls() to transfer buffered data from StreamReader (#142354)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-02-28 23:19:04 +05:30
Nathan Goldbaum
fdb4b3527f
gh-145269: simplify bisect.bisect doc example (#145270)
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>

---------

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
2026-02-28 09:09:39 +00:00
Pablo Galindo Salgado
09e8c38231
gh-145241: specialize SyntaxError for single trailing-comma with item (#145282)
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2026-02-28 02:24:06 +00:00
Hugo van Kemenade
2e2109d224
gh-142927: Tachyon: Fix singular and plurals (#145329) 2026-02-28 01:48:35 +00:00
Bartosz Sławecki
a66d51876d
gh-145334: Make lazy import tests discoverable (#145336) 2026-02-28 01:44:50 +00:00
Stan Ulbrych
4d89056ed0
gh-76007: Deprecate tarfile.version (#145326)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-02-27 18:46:02 +00:00
VanshAgarwal24036
a249795538
gh-145142: Make str.maketrans safe under free-threading (gh-145157) 2026-02-27 16:08:15 +00:00
Pablo Galindo Salgado
98b1e51927
gh-145234: Normalize decoded CR in string tokenizer (#145281) 2026-02-27 12:44:54 +00:00
莯凛
171e0facc4
gh-123853: Cleanup Windows 95 locale fallback support (#144738)
Closes #123853
2026-02-27 11:06:46 +01:00
A.Ibrahim
06b0920f12
gh-142787: Handle empty sqlite3 blob slices (#142824) 2026-02-26 23:40:25 +00:00
AdamKorcz
3fc945df22
gh-144872: fix heap buffer overflow _PyTokenizer_ensure_utf8 (#144807) 2026-02-26 22:35:08 +00:00
Sergey B Kirpichev
f3a381e54f
gh-141510: support frozendict's in the C decimal module (gh-145165) 2026-02-27 07:02:39 +09:00
Serhiy Storchaka
812ef66759
gh-145202: Fix crash in unicodedata's GraphemeBreakIterator and Segment (GH-145216)
Remove the tp_clear slots and make Segment members read-only.

Also add tests for reference loops involving GraphemeBreakIterator
and Segment.
2026-02-26 11:30:08 +02:00
Hai Zhu
277a03711b
gh-145197: Fix JIT trace crash when recording function from cleared generator frame (GH-145220) 2026-02-25 16:52:53 +00:00
Filipe Laíns
56b7dc4e9b
Fix compileall in lazy imports test data with bad syntax (#145221) 2026-02-25 16:27:53 +00:00
Filipe Laíns
80b2b88338
Fix "lazy from (...) import (...)" tests (#145213) 2026-02-25 15:57:06 +00:00
Tadej Magajna
12828e5f98
gh-85809: Ensure shutil.make_archive accepts path-like objects in all cases (GH-143668) 2026-02-25 16:44:17 +02:00