130035 Commits

Author SHA1 Message Date
Serhiy Storchaka
7febbe6b60
gh-144001: Support ignorechars in binascii.a2b_base64() and base64.b64decode() (GH-144024) 2026-01-26 20:11:40 +02:00
Jeong, YunWon
9181d776da
gh-142966: Make ctypes.POINTER.set_type also reset format (GH-142967)
Make the deprecated set_type method resets the format, using the
same code as in type initialization.

Implementation note: this was done in PyCPointerType_init 
after calling PyCPointerType_SetProto, but was forgotten
after in PyCPointerType_set_type_impl's call to
PyCPointerType_SetProto.
With this change, setting the format is conceptually part of
setting proto (i.e. the pointed-to type).

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2026-01-26 17:40:56 +01:00
Victor Stinner
933540e332
gh-101888: Add function.__builtins__ to ref documentation (#144174) 2026-01-26 17:15:47 +01:00
Bartosz Sławecki
04d497c284
gh-142119: Clarify context manager protocol documentation on ContextVar.set and Token (GH-143694) 2026-01-26 16:50:27 +01:00
Jake Lishman
19de10d3d8
gh-140557: Force alignment of empty bytearray and array.array buffers (GH-140559)
This ensures the buffers used by the empty `bytearray` and `array.array`
are aligned the same as a pointer returned by the allocator.  This is a
more convenient default for interop with other languages that have
stricter requirements of type-safe buffers (e.g. Rust's `&[T]` type)
even when empty.
2026-01-26 16:45:17 +01:00
FooIbar
1f55caf97e
gh-144212: Add image/jxl to mimetypes (GH-144213) 2026-01-26 15:26:55 +01:00
Yashraj
923d9d2ac2
gh-143928: Remove outdated comparison between pickle and marshal regarding recursion (#144025) 2026-01-26 14:38:23 +01:00
VanshAgarwal24036
8f459255eb
gh-144100: Fix crash for POINTER(str) used in ctypes argtypes (#144108)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-26 13:27:42 +01:00
Priyanshu Singh
decb25e8f0
gh-144128: Fix crash in array.fromlist with reentrant __index__ (#144138)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-26 13:13:49 +01:00
Solomon Ritzow
9982147433
gh-144233: Fix typo in os.eventfd documentation (#144234) 2026-01-26 10:07:56 +02:00
Jelle Zijlstra
639c1ad4f1
gh-144169: Fix three crashes in AST objects with non-str kwargs (#144178)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-25 17:28:58 -08:00
benediktjohannes
76d3ae71ba
gh-144217: Add dicom support (medical imaging) to mimetypes (GH-144218)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2026-01-25 22:22:43 +00:00
AN Long
6e55337f8a
gh-143995: Eliminate redundant refcounting in the JIT from LOAD_ATTR_MODULE (GH-143996) 2026-01-25 18:24:44 +00:00
Yashraj
a51bf70f95
gh-143504: Expose CELL status of a symbol in symtable (#143549) 2026-01-25 15:21:27 +00:00
Yi Yang
979d92fefc
gh-144140: Optimize len for string constants in optimizer (GH-144142) 2026-01-24 16:09:29 +00:00
mdehoon
27246c3482
Remove stray typedef in _tkinter.c (GH-142924)
Co-authored-by: Michiel de Hoon <mdehoon@tkx288.genome.gsc.riken.jp>
2026-01-24 17:20:14 +02:00
Serhiy Storchaka
012c498035
gh-142037: Improve error messages for printf-style formatting (GH-142081)
This affects string formatting as well as bytes and bytearray formatting.

* For errors in the format string, always include the position of the
  start of the format unit.
* For errors related to the formatted arguments, always include the number
  or the name of the formatted argument.
* Suggest more probable causes of errors in the format string (stray %,
  unsupported format, unexpected character).
* Provide more information when the number of arguments does not match
  the number of format units.
* Raise more specific errors when access of arguments by name is mixed with
  sequential access and when * is used with a mapping.
* Add tests for some uncovered cases.
2026-01-24 11:13:50 +00:00
Marc Mueller
5f736a0432
gh-142913: Add generated test files to gitattributes (GH-144209) 2026-01-24 10:19:21 +00:00
reiden
6d972e0104
gh-130415: Narrow types to constants in branches involving specialized comparisons with a constant (GH-144150) 2026-01-24 10:02:08 +00:00
Hai Zhu
29840247ff
gh-144068: fix JIT tracer memory leak when daemon thread exits (GH-144077) 2026-01-24 09:43:01 +00:00
Yongtao Huang
6f579147e3
Misc: remove duplicate instr_frame assignment in _PyJit_TryInitializeTracing (GH-144155)
Remove duplicate instr_frame assignment in optimizer
2026-01-24 09:37:45 +00:00
Ken Jin
ca99bfdefb
gh-144016: Fix bad stack assert in the JIT optimizer (GH-144019) 2026-01-24 09:36:40 +00:00
AN Long
4e10fa993a
gh-144007: Eliminate redundant refcounting in the JIT for BINARY_OP (GH-144011) 2026-01-24 09:35:32 +00:00
Terry Jan Reedy
29f1e778fa
gh-135142: Initial 3.15 IDLE News3.txt entries (#144200) 2026-01-23 21:34:41 -05:00
Zachary Ware
58ccf21cbb
gh-74902: Avoid hitting unicode.org for test data (GH-144195)
Use our own pythontest.net instead.
2026-01-23 15:07:27 -06:00
Serhiy Storchaka
25a10b60b0
gh-144027: Fix documentation for ignorechars in base64.a85decode() (GH-144028)
It does not support an ASCII string.

Also add more tests.
2026-01-23 20:55:48 +02:00
AN Long
2f42f83344
gh-144005: Eliminate redundant refcounting in the JIT for BINARY_OP_EXTEND (#144006) 2026-01-23 17:19:01 +00:00
Petr Viktorin
70e67f579e
gh-141376: smelly.py: Print only smelly symbols, or all of them with --verbose (GH-141394)
Instead of long and uninteresting output for all checked libraries, only print found issues by default.

Add a new -v/--verbose option to list all symbols (useful for checking that the script finds the symbols).
2026-01-23 17:51:29 +01:00
Bartosz Sławecki
03e651d601
Programming FAQ: fix some punctuaction typos (GH-144058)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-01-23 17:34:21 +01:00
Seth Michael Larson
052e55e7d4
gh-144125: email: verify headers are sound in BytesGenerator
Co-authored-by: Denis Ledoux <dle@odoo.com>
Co-authored-by: Denis Ledoux <5822488+beledouxdenis@users.noreply.github.com>
Co-authored-by: Petr Viktorin <302922+encukou@users.noreply.github.com>
Co-authored-by: Bas Bloemsaat <1586868+basbloemsaat@users.noreply.github.com>
2026-01-23 14:59:35 +00:00
Yongtao Huang
f3dd0cae6c
Doc: fix incorrect reference in isasyncgenfunction docs (GH-144099)
Fix incorrect reference in isasyncgenfunction docs
2026-01-23 09:06:47 +01:00
Alex Willmer
f8262b84f5
gh-143513: Remove importlib.abc documentation for removed ABCs (#143605)
In 3.11 ResourceReader, Traversable, & TraversableResources moved from importlib.abc to importlib.resources.abc (commit e712a5b277866a71c195f38c1b5d87d9126dba3e).

In 3.12 old import locations were deprecated (commit 71848c960927af801656026203371c41ad139b5a).

In 3.14 backwards-compat support was removed (commit 0751511d24295c39fdf2f5b2255e3fa3d796ce4d).

Co-authored-by: Brett Cannon <brett@python.org>
2026-01-22 14:00:37 -08:00
Dimma Don't
5b2d49b7da
Add source links to documentation for Windows-specific modules (GH-130244) 2026-01-22 21:30:13 +00:00
Sam Gross
ee4e14aa4c
gh-143756: Avoid borrowed reference in SSL code (gh-143816)
GET_SOCKET() returned a borrowed reference, which was potentially
unsafe. Also, refactor out some common code.
2026-01-22 14:02:48 -05:00
Sam Gross
bcf9cb0217
gh-143756: Fix potential data race in SSLContext.load_cert_chain (gh-143818)
Concurrent calls to `load_cert_chain` caused data races in OpenSSL code.
2026-01-22 14:02:30 -05:00
Gregory P. Smith
a966d94e76
gh-144157: Optimize bytes.translate() by deferring change detection (GH-144158)
Optimize bytes.translate() by deferring change detection

Move the equality check out of the hot loop to allow better compiler
optimization. Instead of checking each byte during translation, perform
a single memcmp at the end to determine if the input can be returned
unchanged.

This allows compilers to unroll and pipeline the loops, resulting in ~2x
throughput improvement for medium-to-large inputs (tested on an AMD zen2).
No change observed on small inputs.

It will also be faster for bytes subclasses as those do not need change
detection.
2026-01-22 09:21:07 -08:00
stratakis
77bf4ba732
gh-142779: Initialize reserved field for proper padding (#142780)
The jitdump specification specifies a reserved field for padding.

Initialize it so no garbage data is embedded in the jitdump files.
2026-01-22 18:06:36 +01:00
Serhiy Storchaka
c5cfcdf16a
gh-67041: Allow to distinguish between empty and not defined URI components (GH-123305)
Changes in the urllib.parse module:

* Add option missing_as_none in urlparse(), urlsplit() and urldefrag(). If
  it is true, represent not defined components as None instead of an
  empty string.
* Add option keep_empty in urlunparse() and urlunsplit(). If it is
  true, keep empty non-None components in the resulting string.
2026-01-22 14:29:13 +02:00
Jeong, YunWon
67535ab2d2
gh-143001: Add @cpython_only to test_sys.test_current_frames() (#144004) 2026-01-22 12:08:08 +01:00
Mark Shannon
d77aaa7311
GH-139109: Partial reworking of JIT data structures (GH-144105)
* Halve size of buffers by reusing combined trace + optimizer buffers for TOS caching
* Add simple buffer struct for more maintainable handling of buffers
* Decouple JIT structs from thread state struct
* Ensure terminator is added to trace, when optimizer gives up
2026-01-22 10:55:49 +00:00
Petr Viktorin
fb690c38ca
gh-141004: Mark up constants for PyOS_double_to_string (GH-143867)
This ensures they show up as C macros in search and the Sphinx inventory.
2026-01-22 11:53:17 +01:00
Jeong, YunWon
c447d1bc14
gh-143959: Make _datetime optional for test_sys (GH-144003) 2026-01-22 12:52:16 +02:00
Rafael Weingartner-Ortner
0b5f8359c5
gh-143993: Document ways to disable remote debugging support (#143994)
Although PEP 768 mentions how to disable the mechanism of
remote debugging, it is not documented in the Python docs.

This change adds a note on how to disable remote debugging support
in a Python interpreter to the remote debugging how-to.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-01-22 11:41:20 +01:00
Petr Viktorin
3e66171efa
gh-142913: Revert adding test_replaced_interpreter (GH-144110)
This partially reverts commit 4d5a676aa0811563ea78ae58ef89cdc0295bf7ed
(GH-142911)

The removed test fails when re-run in --huntrleaks mode.
2026-01-22 10:40:34 +01:00
reiden
0b08438ea6
gh-130415: Narrowing to constants in branches involving is comparisons with a constant (GH-143895) 2026-01-22 09:37:45 +00:00
Brett Cannon
6181b69970
GH-143941: Move WASI-related files to Platforms/WASI (GH-143942)
Along the way, leave a deprecated Tools/wasm/wasi/__main__.py behind for backwards-compatibility.

Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
2026-01-21 14:31:58 -08:00
Serhiy Storchaka
cf71e34940
gh-77188: Add pickle tests for objects with slots (GH-144116) 2026-01-21 19:21:02 +02:00
Mark Shannon
9eab67d507
GH-138245: Perform boolean guards by testing a single bit, rather than a full pointer comparison. (GH-143810) 2026-01-21 15:58:27 +00:00
Steve Dower
f52af86cba
Update install manager docs (python/pymanager#227) (GH-144079) 2026-01-21 15:33:05 +00:00
CF Bolz-Tereick
5db331a561
gh-144030: Add check that argument is callable to Python version of functools.lru_cache (#144031)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: AN Long <aisk@users.noreply.github.com>
2026-01-21 15:19:19 +01:00