130025 Commits

Author SHA1 Message Date
Sam Gross
43bb6300b3
gh-143939: Fix assignment to _PyThreadStateImpl.generator_return_kind (gh-143951)
The assignment to generator_return_kind has to be after any potentially
escaping calls to ensure that it's not overwritten.
2026-01-20 17:51:55 +00:00
Hugo van Kemenade
a126893fa8
gh-143960: Add support for OpenSSL 3.6, drop EOL 3.2 (#143961)
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2026-01-20 17:25:31 +02:00
Neil Schemenauer
795d5c5b44
gh-144054: shutdown fix for deferred ref counting (GH-144055)
When shutting down, disable deferred refcounting for all GC objects. It
is important to do this also for untracked objects, which before this
change were getting missed.

Small code cleanup:
We can remove the shutdown case disable_deferred_refcounting() call
inside scan_heap_visitor() if we are careful about it.  The key is
that frame_disable_deferred_refcounting() might fail if the object
is untracked.
2026-01-20 14:45:12 +01:00
Sergey B Kirpichev
31c81ab0a2
Update struct.__doc__: _Bool available unconditionally (#143716)
This amends commit a9296e7f3be4d6c22271b25c86467ff867c63bbb.
2026-01-20 13:09:20 +01:00
VanshAgarwal24036
fe629262c0
gh-144050: Fix stat.filemode pure Python file type detection (GH-144059) 2026-01-20 14:05:42 +02:00
Yongtao Huang
76b484b9d1
gh-143999: Fix: handle suspended state on types.coroutine wrappers (GH-144000) 2026-01-20 10:20:06 +00:00
AZero13
fa44efa0ef
gh-144023: Prevent follow_symlinks from being allowed with an fd of 0 (GH-144022)
The check was (fd > 0), should be (fd >= 0).
2026-01-20 11:50:51 +02:00
Terry Jan Reedy
fa3abf5a51
gh-143774 - Improve IDLE Format Paragraph doc (#143775)
Add a reminder to not rewrap code line to the Menu => Format => Reformat Paragraph entry.
In Editing and Nagivagion, add a new 'Format block' subsection that defines 'paragraph'
to better match what is dependably handled as more or less expected.
In particular, specify equal indents and that the resulting indent equals original indent.
Also mention that selections are expanded to complete lines and how to modify max length.

(Also fix a couple case errors in cross references.)
2026-01-20 04:07:29 -05:00
Serhiy Storchaka
71cbffde61
gh-143754: Add Tkinter methods pack_content(), place_content() and grid_content() (GH-143845)
They use Tk commands with new name like "pack content instead of old
"pack slaves".
2026-01-20 09:16:36 +02:00
Bodhi Silberling
05eab96435
Fix typo: 'exept' -> 'except' in Lib/dbm/dumb.py (GH-144060) 2026-01-20 08:50:34 +02:00
Yongtao Huang
e66597d6c8
gh-143874: Use self.message instead of raw print in _exec_in_closure() (#143875) 2026-01-19 16:11:07 -08:00
Bartosz Sławecki
f84ea11071
gh-102809: No longer mention Misc/gdbinit in the code (#143980)
Fix misleading comment on `PyObject_Dump`.
2026-01-19 18:36:55 +01:00
Adorilson Bezerra
3c9c3d33cb
gh-106318: Add examples for str.rpartition() method (#143891) 2026-01-19 15:15:55 +01:00
Yongtao Huang
375e372c66
gh-143689: Fix BufferedReader.read1 leaving object in reentrant state on error (#143690)
BufferedReader.read1() could leave the buffered object in a
reentrant (locked) state when an exception was raised while
allocating the output buffer.

This change ensures the internal buffered lock is always released
on error, keeping the object in a consistent state after failures.

Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
2026-01-19 15:09:30 +01:00
Aniket
72bacb0cd0
gh-142461: Move misplaced NEWS entries to an appropriate section (GH-143392) 2026-01-19 14:59:26 +02:00
Seth Michael Larson
17d1490aa9
gh-143935: Email preserve parens when folding comments (#143936)
Fix a bug in the folding of comments when flattening an email message
using a modern email policy. Comments consisting of a very long sequence of
non-foldable characters could trigger a forced line wrap that omitted the
required leading space on the continuation line, causing the remainder of
the comment to be interpreted as a new header field. This enabled header
injection with carefully crafted inputs.

Co-authored-by: Denis Ledoux <dle@odoo.com>
2026-01-19 12:38:22 +00:00
Serhiy Storchaka
bb2b9ba49d
gh-143897: Remove the isxidstart() and isxidcontinue() methods of unicodedata.ucd_3_2_0 (GH-143898)
They are now only exposed as the unicodedata function.
2026-01-19 12:37:41 +00:00
AZero13
7dca4e3af1
gh-142440: Fix _decimal builds configured with EXTRA_FUNCTIONALITY (GH-142441)
There was a typo in _decimal.Context.apply().
2026-01-19 14:19:20 +02:00
Serhiy Storchaka
813fc7a291
gh-143754: Modernize Tkinter docs (GH-143841)
Use more relevant terminology instead of "master"/"slave" widgets where possible.
2026-01-19 14:01:29 +02:00
b9788213
cb6a662bb0
gh-143866: Verify return value of pathlib.write_{bytes,text} methods in tests (#143870)
Co-authored-by: sobolevn <mail@sobolevn.me>
2026-01-19 14:24:20 +03:00
Sergey B Kirpichev
d8ab1c79b0
gh-75459: versionadded for PyObject_CallFinalizer*() API (GH-143982) 2026-01-19 11:22:16 +01:00
Bartosz Sławecki
59d3594ca1
gh-143831: Compare cells by identity in forward references (#143848) 2026-01-18 21:29:11 -08:00
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко)
78b1370de9
Notify Sviat of GHA changes through codeowners (#143945)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-01-19 00:28:38 +02:00
Gregory P. Smith
c879b2a7a5
gh-141860: Add on_error= keyword arg to multiprocessing.set_forkserver_preload (GH-141859)
Add a keyword-only `on_error` parameter to `multiprocessing.set_forkserver_preload()`. This allows the user to have exceptions during optional `forkserver` start method module preloading cause the forkserver subprocess to warn (generally to stderr) or exit with an error (preventing use of the forkserver) instead of being silently ignored.

This _also_ fixes an oversight, errors when preloading a `__main__` module are now treated the similarly. Those would always raise unlike other modules in preload, but that had gone unnoticed as up until bug fix PR GH-135295 in 3.14.1 and 3.13.8, the `__main__` module was never actually preloaded.

Based on original work by Nick Neumann @aggieNick02 in GH-99515.
2026-01-18 14:04:18 -08:00
AN Long
54bedcf714
gh-144012: Check null binary op extend (#144014) 2026-01-19 02:38:37 +08:00
Bartosz Sławecki
63cc1257db
gh-143952: Fix asyncio tools to work with the new remote debugging API (#143954) 2026-01-17 19:16:12 -05:00
Shamil
7ca9e7ad05
Fix UBSan error in _testcapi: correct create_attr_from_spec signature (#143097)
Co-authored-by: sobolevn <mail@sobolevn.me>
2026-01-17 18:05:09 +00:00
Seth Michael Larson
f7fceed79c
gh-143916: Reject control characters in wsgiref.headers.Headers (GH-143917)
* Add 'test.support' fixture for C0 control characters
* gh-143916: Reject control characters in wsgiref.headers.Headers
2026-01-17 09:46:21 -08:00
Hai Zhu
b4b73245d8
gh-143421: Use new buffer to save optimized uops (GH-143682) 2026-01-17 15:52:16 +00:00
Peter Bierma
d51c01a271
gh-141004: Document PyException_HEAD and PyDescr_COMMON (GH-143896) 2026-01-17 10:39:29 -05:00
Hai Zhu
61ec66acd5
gh-143946: Show JitOptSymbol on abstract stack when set PYTHON_OPT_DEBUG > 4 (GH-143957) 2026-01-17 15:20:35 +00:00
Ken Jin
7e28ae550f
gh-142913: Export JIT functions for _testinternalcapi (#143958)
* Export JIT functions for _testinternalcapi

* Add testinternalcapi to paths to run JIT CI on
2026-01-17 13:31:38 +00:00
Hai Zhu
7d151e552c
gh-143943: add missing header file for pycore_optimizer_types.h (GH-143947) 2026-01-17 12:26:19 +00:00
Neil Schemenauer
bb25f7280a
gh-132657: Add maybe_enable_deferred_ref_count() (gh-142843)
If we are specializing to `LOAD_GLOBAL_MODULE` or `LOAD_ATTR_MODULE`, try
to enable deferred reference counting for the value, if the object is owned by
a different thread.  This applies to the free-threaded build only and should
improve scaling of multi-threaded programs.
2026-01-17 01:54:43 +00:00
Ken Jin
949b5ec8e6
gh-142913: Remove JIT interpreter for interpreter generator tests (GH-143944) 2026-01-17 00:34:39 +00:00
Hugo van Kemenade
3199cfcf76
gh-138122: Default highlight to sh (#143782) 2026-01-16 21:40:28 +02:00
Dino Viehland
5996636ab5
gh-142913: Update generated code that conflicted with other landed change (#143932)
Update test cases
2026-01-16 11:10:15 -08:00
Dino Viehland
4d5a676aa0
gh-142913: Add test case for interpreter generator w/ overridden opcodes (#142911)
Add test case for interpreter generator w/ overridden opcodes
2026-01-16 10:33:29 -08:00
Muneeb Ullah
3e93225798
gh-143674: Document F/D complex format characters in struct module (#143675)
Add documentation for the F (complex from two floats) and D (complex
from two doubles) format characters in the struct module docstring.
These format characters were implemented but not documented.

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2026-01-16 18:09:56 +01:00
Serhiy Storchaka
21ed1e2a94
gh-65784: Add support for parametrized resource wantobjects in regrtests (GH-143570)
This allows to run Tkinter tests with the specified value of
tkinter.wantobjects, for example "-u wantobjects=0".
2026-01-16 18:38:38 +02:00
Seth Michael Larson
edeebe22cb
gh-143572: Run 'python3-libraries' fuzzer in CI using CIFuzz (#143749)
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <578543+webknjaz@users.noreply.github.com>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-01-16 18:09:39 +02:00
Peter Bierma
19e64afddf
gh-141070: Rename PyUnstable_Object_Dump to PyObject_Dump (GH-142848) 2026-01-16 09:19:43 -05:00
Serhiy Storchaka
780e9692fe
gh-143672: Finish conversion of the struct module to Argument Clinic (GH-143857)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2026-01-16 13:35:23 +02:00
Serhiy Storchaka
66680f1230
gh-143672: Add more tests for struct.pack_into() (GH-143901)
Add tests for negative offset, out of bound offset, invalid type of offset,
non-writeable buffer, non-continuous buffer, invalid type of buffer.

Repeat all tests for struct.Struct.pack_into().
2026-01-16 11:24:43 +00:00
Mark Shannon
ae53da5758
GH-143493: Conform to spec for generator expressions while supporting virtual iterators (GH-143569)
* Moves the `GET_ITER` instruction into the generator function preamble.
  This means the the iterable is converted into an iterator during generator
  creation, as documented, but keeps it in the same code object allowing
  optimization.
2026-01-16 09:11:58 +00:00
zhong
c461aa99e2
gh-143602: Fix duplicate buffer exports in io.BytesIO.write (#143629)
Fix an inconsistency issue in io.BytesIO.write() where the buffer was exported
twice, which could lead to unexpected data overwrites and position drift when
the buffer changes between exports.
2026-01-15 16:08:55 +01:00
Victor Stinner
3514ba2175
gh-142434: Use ppoll() if available in select.poll (#143529) 2026-01-15 13:49:46 +01:00
Petr Viktorin
a009e78b79
gh-141004: Mark up docs of old PyMem macros (GH-143783)
These had a docs-only deprecation notice since the first version of the docs in this repo. Nowadays we call things “soft deprecated” if there's just a note in the docs.

The deprecated directive needs a version, I went with the first one that had the notice (2.0; it's not in 1.6):
- https://docs.python.org/release/2.0/api/memoryInterface.html
- https://docs.python.org/release/1.6/api/memoryInterface.html

Since PEP 445, they are now direct aliases; there are no (additional) binary compatibility concerns over the preferred names.
2026-01-15 12:37:30 +01:00
Victor Stinner
1597d00d96
gh-80620: Fix test_time.test_gmtime() for 32-bit time_t (#143861) 2026-01-15 11:54:30 +01:00
Peter Gessler
f5685a266b
gh-80620: Support negative timestamps on windows in time.gmtime, time.localtime, and datetime module (#143463)
Previously, negative timestamps (representing dates before 1970-01-01) were
not supported on Windows due to platform limitations. The changes introduce a
fallback implementation using the Windows FILETIME API, allowing negative
timestamps to be correctly handled in both UTC and local time conversions.
Additionally, related test code is updated to remove Windows-specific skips
and error handling, ensuring consistent behavior across platforms.

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-15 10:51:11 +01:00