Commit Graph
132289 Commits
Author SHA1 Message Date
Lukas GeigerandGitHub 65afd6579f gh-141968: Use take_bytes to simplify and remove copy from pyrepl BaseEventQueue (#149852) 2026-07-11 16:59:37 +01:00
Matt Van HornandGitHub 931cfdf8ed gh-145694: Update tutorial indentation guidance for PyREPL auto-indent (#145725)
The tutorial stated users must manually type tabs/spaces at the interactive
prompt, which is no longer accurate since the PyREPL in Python 3.13+
auto-indents after compound statement headers. Updated to mention both
the default REPL behavior and the basic REPL fallback.
2026-07-11 16:57:37 +01:00
7671ee1eba gh-152431: update StreamReader transport after StreamWriter.start_tls() (#152432)
Co-authored-by: Kumar Aditya <[email protected]>
2026-07-11 13:03:23 +00:00
DupratandGitHub d1a5b54aba gh-152614: Add raises to QueueShutDown in asyncio.Queue.put_no_wait and asyncio.Queue.get_nowait documentation methods (#152681) 2026-07-11 17:59:38 +05:30
9ca892717e gh-86726: Note that the ttk Treeview separator column option needs Tk 9.0 (GH-153556)
Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-11 13:10:27 +03:00
ff0a9ae269 gh-126877: Fix the configure check for Tcl/Tk with optimizing compilers (GH-153543)
The check assigned the addresses of Tcl_Init() and Tk_Init() to unused
variables, which optimizing compilers can eliminate, so it linked even
when the libraries were missing.  Call the functions instead.

Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-11 09:49:12 +00:00
77cb7560c0 gh-86726: Fix and improve tkinter documentation and docstrings (GH-153549)
Correct inaccurate return-type and option descriptions in the tkinter
reference, and add missing module and class docstrings.

Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-11 09:46:06 +00:00
d52cfd2a0e gh-88647: Fix tkinter config() docs for synonym options (GH-153544)
Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-11 08:13:37 +00:00
Jakob RossiandGitHub a1ef41ab41 gh-151540: Use a selector event loop in the happy-eyeballs tests (#153375) 2026-07-11 12:47:42 +05:30
93128f52f2 gh-50409: Modernize tkinter.PanedWindow.paneconfigure() (GH-152399)
Rename the first parameter of paneconfigure() (and its paneconfig alias)
from 'tagOrId' to 'child', for consistency with add(), remove() and
panecget() -- PanedWindow panes are child widgets, not tagged items.  The
old 'tagOrId' keyword still works but raises DeprecationWarning.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-11 06:01:54 +00:00
f212f219a5 gh-152638: Deprecate tkinter.filedialog.askopenfiles() (GH-152647)
Opening several files at once is error-prone, and the returned list
cannot be used in a "with" statement.  Iterate over the names returned
by askopenfilenames() and open them one by one instead.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-11 05:53:02 +00:00
b39dfe266e gh-72880: Add tkinter.fontchooser -- interface to the font selection dialog (GH-153255)
The FontChooser class wraps the "tk fontchooser" command.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-11 05:50:08 +00:00
342e5a4218 gh-153259: Add tkinter.systray -- system tray icon and notifications (GH-153260)
Add the tkinter.systray module with the SysTrayIcon class wrapping the
"tk systray" command and the notify() function wrapping "tk sysnotify"
(Tk 8.7/9.0 and newer).

Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-11 08:34:13 +03:00
45fa07b025 gh-153256: Add tk_print() methods to tkinter Canvas and Text (GH-153257)
The native print dialog (the "tk print" command, Tk 8.7/9.0+) only
supports canvas and text widgets, so expose it as a method of Canvas
and Text rather than of Misc.

Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-11 05:12:52 +00:00
tonghuaroot (童话)andGitHub bac73b0f4e gh-153333: Read tkinter profile scripts with the source file's encoding (GH-153334)
Tk.readprofile ran the user's ~/.CLASS.py and ~/.BASE.py scripts with
exec(open(path).read()), decoding them with the locale encoding.  Read
them in binary mode so exec() honors each script's own coding cookie.
2026-07-11 04:42:35 +00:00
Stan UlbrychandGitHub c22e9c9dae gh-152216: Update bundled expat to 2.8.2 (GH-152234)
* Update bundled expat to 2.8.2
* `make regen-sbom`
* Update download URL
* Drop warnings (yay!)
2026-07-10 11:40:12 -07:00
Victor StinnerandGitHub 0293eacc24 gh-153300: Reuse PYCONFIG_SPEC in config_set_global_vars() (#153471)
No longer hardcode global configuration variables. Use the
PyConfigGlobalVar member of PYCONFIG_SPEC.
2026-07-10 19:59:27 +02:00
811974aa65 gh-151914: Reorganize the curses entries in What's New in Python 3.16 (GH-153397)
Order the curses entries from the most important and general to the more
specialized: wide-character and complexchar/complexstr support first, then
multiple-terminal support, attributes and colors, screen and window management,
input handling, and finally introspection.  The curses.textpad.Textbox entry,
belonging to a separate submodule, moves to the end.

Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-10 20:51:16 +03:00
fbce45b587 gh-59396: Add use_ttk parameter to tkinter ScrolledText (GH-153119)
ScrolledText gained a keyword-only use_ttk parameter to build the
surrounding frame and the vertical scroll bar from the themed
tkinter.ttk widgets instead of the classic tkinter widgets.  The
classic widgets remain the default.

Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-10 17:16:53 +00:00
6d5908368d gh-116946: Implement the GC protocol for _tkinter tkapp and tktimertoken (GH-152310)
The _tkinter.tkapp and _tkinter.tktimertoken types never implemented the
garbage collector protocol, so reference cycles through an interpreter's
trace function or a timer handler's callback could not be collected.

A pending timer is kept alive by the Tcl event loop, which fires it even
after the Python token is dropped, so it is treated as a GC root (only its
callback is traversed) and collecting it never cancels a live timer.  The
GC slots use a plain cast rather than the type-checking macro, since the
collector may visit a surviving object at shutdown after module clearing
has reset the global type pointers.  Deallocation cancels any pending timer
so its callback cannot run on freed memory.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
2026-07-10 19:44:44 +03:00
Serhiy StorchakaandGitHub c59c95f7b4 gh-143070: Use "+" instead of "!" in automatically generated tkinter widget names (GH-151975)
The "!" prefix has a special meaning in the tag expressions of the
canvas and text widgets ("!", "&&", "||", "^" and parentheses), so an
automatically generated widget name could not be used as a tag.  "+" has
no special meaning there, nor in option database patterns or Tcl lists,
and a user is very unlikely to start an explicit name with it.
2026-07-10 19:36:12 +03:00
f96c4279e9 gh-153513: Remove redundant conversions in tkinter tests (GH-153520)
Now that index, window, parsedVarName and pixel options are returned as
str, int or float, drop the str()/int()/float() wrappers that only
worked around Tcl_Obj results.  The generated test_configure_* tests now
also check that int- and float-valued options are returned as numbers.

Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-10 19:04:49 +03:00
5aafbea2c9 gh-153494: Encode imaplib search criteria to the declared CHARSET (GH-153495)
IMAP4.search(), sort(), thread() and the uid SORT/THREAD variants now encode
str search criteria to the declared charset, so international search text can
be passed as ordinary str.  A criterion passed as bytes is sent unchanged, for
use with a charset that Python has no codec for.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-10 18:42:07 +03:00
8a32914f78 gh-153513: Return str and numbers for more Tcl object types in _tkinter (GH-153514)
FromObj() now returns str for the "index", "window", "nsName" and
"parsedVarName" object types, whose internal representation is only a
context-bound lookup with nothing worth preserving in a Tcl_Obj.  An
"index" value is one of a small fixed set of enumeration keywords, so
its str is interned.

A "pixel" screen distance with no unit suffix is screen independent and
is now returned as an int or float.  A distance with an m/c/i/p suffix
needs a Tk_Window to be resolved and is kept as a Tcl_Obj, as are the
"dict" and the resource types "color", "border", "font" and "cursor".

Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-10 17:29:53 +03:00
Bartosz SławeckiandGitHub b276b88e38 gh-151213: Fix asyncio tools permission requirements link (#153493) 2026-07-10 19:24:18 +05:30
Daniele NicolodiandGitHub cc31641017 gh-151669: Normalize symlink targets in tarfile.TarFile.gettarinfo() (GH-151671)
This applies a normalization when creating members vrom the filesystem,
 complementary to the one added to tarfile.TarFile.extract() in gh-138309
that does it in the other direction.
This solves an issue with round-tripping through the filesystem.
2026-07-10 15:53:01 +02:00
c98e984b12 gh-153502: Add uid parameter to imaplib command methods (GH-153508)
Add a keyword-only uid=False argument to IMAP4.copy(), move(), fetch(),
store(), search(), sort(), thread() and expunge(), selecting the UID
variant of the command as a shorthand for uid().  expunge() also gains
an optional message_set argument, required for UID EXPUNGE.

Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-10 15:08:11 +03:00
Harjoth KharaandGitHub 106eb532ea gh-153438: Update NuGet download URL (GH-153482) 2026-07-10 12:13:08 +01:00
Stan UlbrychandGitHub fc9fe142f8 gh-151942: Fix all Sphinx nitpicks in the Python 2.4 What's New (#153116) 2026-07-10 10:18:15 +00:00
Stan UlbrychandGitHub fb00514a1a gh-151942: Fix all Sphinx nitpicks in the 2.5 What's New (#153120) 2026-07-10 12:08:31 +02:00
Kumar AdityaandGitHub d071438827 gh-153201: Make TSan CI mandatory (#153491) 2026-07-10 09:36:26 +00:00
Petr ViktorinandGitHub 9324f84b0f gh-145633: Allow PyFloat_Pack8 & PyFloat_UnPack* to fail in future CPython versions (GH-153440) 2026-07-10 10:35:35 +02:00
6c389c446e gh-153062: Fix a crash iterating itertools.tee on the free-threaded build (gh-153063)
itertools.tee branches share a linked list of teedataobject cells.  On the free-threaded build, iterating one branch from multiple threads, or iterating sibling branches concurrently, raced on the shared cells and each branch's position, corrupting refcounts and crashing.

Lock each teedataobject while reading, extending, or clearing it, and snapshot each branch's position under the tee object's own lock, revalidating before advancing, so the two locks are never nested.  Concurrent iteration of one tee is undefined and may raise RuntimeError as documented, but no longer crashes.

The free-threading snapshot and revalidation add per-element overhead on the default build, where the GIL already serializes access. Guard that path under Py_GIL_DISABLED so the default build keeps the original iteration and the free-threaded path is unchanged.

Co-authored-by: Neil Schemenauer <[email protected]>
2026-07-09 19:38:58 -07:00
Victor StinnerandGitHub d83d26724b gh-152132: Test Py_CompileString() in test_capi.test_run (#153470)
PyRun functions now raises ValueError if the start argument is
invalid.

* Add Modules/_testlimitedcapi/run.c.
* Rename _Py_CompileStringObjectWithModule() to
  _Py_CompileStringObject().
2026-07-10 03:36:31 +02:00
Victor StinnerandGitHub 1b41c7b722 gh-152132: Enhance Py_RunMain() and fix bugs (#153461)
* Check for signals more often. Previously, a pending exception could
  be removed by PyErr_Clear().
* Only call _PyInterpreterState_SetNotRunningMain() if
  _PyInterpreterState_SetRunningMain() has been called.
* Add pymain_error() and pyrun_error(): write the error message to
  sys.stderr instead of the C stream stderr.
* Convert _PyPathConfig_UpdateGlobal() PyStatus error to an
  exception.
* Simplify pymain_run_startup(): avoid strerror() which is decoded
  from the wrong encoding. Instead display the exception, Py_fopen()
  raises an OSError with the path object (and can raise other exceptions).
* Add pymain_set_path0() function.
* Add _PySys_FormatV() function.
2026-07-10 01:29:53 +02:00
Neil SchemenauerandGitHub 87e5aac5ec Use enums for pycore_uop_ids.h. (gh-153351)
This generally reduces the sizes of diffs when uops are added or
removed.  It also helps avoid merge conflicts.
2026-07-09 15:08:36 -07:00
stratakisandGitHub a159c6851f gh-98894: Quote test_dtrace tracer subcommands (#152901)
Use shlex.join() when building tracer -c command strings
for avoiding issues with spaces.
2026-07-09 22:43:54 +02:00
Victor StinnerandGitHub 3114449981 gh-121608: Fix test_samply_profiler: only check samply once (#153424)
Only run samply_command_works() once. Remove also dead code.
2026-07-09 21:27:40 +02:00
Xiaowei LuandGitHub b9e8979dcd gh-152769: Enable perf trampoline on musl (Alpine Linux) (#152774) 2026-07-09 21:17:40 +02:00
Victor StinnerandGitHub fac72f1ee9 gh-152132: Fix Py_RunMain() to return an exit code (#153446)
* Fix Py_RunMain() to return an exit code, rather than calling
  Py_Exit(), when running a script, a command, or the REPL.
* _PyRun_SimpleFile() now logs errors to stderr, for example if setting
  __main__.__file__ fails.
* Add tests on Py_RunMain() exitcode.
* Rename functions:

  * _PyRun_SimpleStringFlagsWithName() => _PyRun_SimpleString()
  * _PyRun_SimpleFileObject() => _PyRun_SimpleFile()
  * _PyRun_AnyFileObject() => _PyRun_AnyFile()
  * _PyRun_InteractiveLoopObject() => _PyRun_InteractiveLoop()

* Change _PyRun_SimpleString(), _PyRun_SimpleFile(), _PyRun_AnyFile() and
  _PyRun_InteractiveLoop() return type to PyObject*.
* pymain_repl() now displays the error if PySys_Audit() or
  import _pyrepl failed.
* PyRun_SimpleFileExFlags() and PyRun_AnyFileExFlags() now log
  PyUnicode_DecodeFSDefault() error. So these functions can no longer
  return -1 with an exception set.
2026-07-09 18:28:15 +00:00
Hugo van KemenadeandGitHub 6ba3ad55bd gh-146531: Broaden wm_iconbitmap skip on macOS 26 Intel (#153348) 2026-07-09 21:23:31 +03:00
39a817e7b4 gh-152905: Decode LC_TIME items in nl_langinfo() from glibc wide data (GH-152911)
On glibc, locale.nl_langinfo() now decodes the LC_TIME text items from the
wide (_NL_W*) locale data, independently of the LC_CTYPE encoding.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-09 17:36:08 +00:00
3ce7a1211c gh-152997: Support system locale encodings via an iconv-based codec (GH-153001)
Where the C library provides iconv(), the codecs module now exposes every
encoding iconv() knows but Python has no built-in codec for -- the POSIX
counterpart of the Windows code-page support.  Use it by name (e.g.
"cp1133"), or with an "iconv:" prefix to force it over a built-in codec.

The codec is a last-resort search function and never shadows a built-in.
Both directions pivot through native-endian UTF-32, keeping one input unit
per code point so error handlers get the exact string position.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-09 20:01:32 +03:00
sobolevnandGitHub 33678dc79f gh-153444: Fix compile warning in Modules/_interpchannelsmodule.c (#153445) 2026-07-09 19:08:29 +03:00
25bd6eb437 gh-49555: Support international mailbox names in imaplib (GH-153391)
Non-ASCII mailbox names are now encoded as modified UTF-7 (RFC 3501,
section 5.1.3), so they can be passed as an ordinary str.

Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-09 19:02:56 +03:00
eacb85a2b2 gh-90092: Fix test_curses when stdin is write-only (e.g. under nohup) (GH-153420)
newterm() needs a readable input fd, but nohup can leave stdin write-only.
Fall back to the output fd, as already done when stdin has no fileno.

Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-09 15:43:26 +00:00
dd8739a35b gh-153422: Return bool from some tkinter query methods (GH-153429)
The winfo_exists(), winfo_ismapped() and winfo_viewable() methods of
tkinter widgets and Text.edit_modified() now return a bool instead of an
integer or, depending on wantobjects, a string.

Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-09 14:13:42 +00:00
Maurycy Pawłowski-WierońskiandGitHub 1d196507e6 gh-151292: Change total_samples:u32 in the binary format to total_samples:u64 (#153425) 2026-07-09 13:59:28 +00:00
tonghuaroot (童话)andGitHub 37a26b9b94 gh-153406: Raise ValueError, not OverflowError, for out-of-range dates in email.utils.parsedate_to_datetime (#153407)
email.utils.parsedate_to_datetime documented that it raises ValueError for an invalid date, but it leaked OverflowError when the parsed year or timezone offset was too large for the datetime and timedelta constructors, and that OverflowError also escaped the modern header parsing path since DateHeader.parse only caught ValueError. Wrap the datetime and timezone construction so an OverflowError is re-raised as a ValueError with the original chained as the cause, which restores the documented contract and lets the existing header handler record an InvalidDateDefect instead of raising.
2026-07-09 09:58:56 -04:00
11f1b70f4c gh-153417: Fix BytesWarning in imaplib error messages for bytes arguments (GH-153423)
IMAP4.select() and IMAP4.uid() formatted the mailbox and command argument
with %s in their error messages, which raised BytesWarning under -bb when the
argument was bytes and masked the real error.  Use %r instead, which is safe
for bytes and also quotes the value.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-09 13:51:45 +00:00