From 21812d5c0f21491cf651563dd4b31e83a2ac9c67 Mon Sep 17 00:00:00 2001 From: su-213 <3103124410@qq.com> Date: Mon, 13 Jul 2026 11:19:12 +0800 Subject: [PATCH 1/2] gh-153621: Expose raw libzstd error code in ZstdError messages Include the raw error code returned by libzstd in all ZstdError messages, making it easier for users to diagnose compression and decompression issues. --- Modules/_zstd/_zstdmodule.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/Modules/_zstd/_zstdmodule.c b/Modules/_zstd/_zstdmodule.c index 94246dd93b17de..9c372ea038ee92 100644 --- a/Modules/_zstd/_zstdmodule.c +++ b/Modules/_zstd/_zstdmodule.c @@ -67,45 +67,52 @@ set_zstd_error(const _zstd_state *state, error_type type, size_t zstd_ret) } switch (type) { case ERR_DECOMPRESS: - msg = "Unable to decompress Zstandard data: %s"; + msg = "Unable to decompress Zstandard data: %s (error code %llu)"; break; case ERR_COMPRESS: - msg = "Unable to compress Zstandard data: %s"; + msg = "Unable to compress Zstandard data: %s (error code %llu)"; break; case ERR_SET_PLEDGED_INPUT_SIZE: - msg = "Unable to set pledged uncompressed content size: %s"; + msg = "Unable to set pledged uncompressed content size: %s " + "(error code %llu)"; break; case ERR_LOAD_D_DICT: msg = "Unable to load Zstandard dictionary or prefix for " - "decompression: %s"; + "decompression: %s (error code %llu)"; break; case ERR_LOAD_C_DICT: msg = "Unable to load Zstandard dictionary or prefix for " - "compression: %s"; + "compression: %s (error code %llu)"; break; case ERR_GET_C_BOUNDS: - msg = "Unable to get zstd compression parameter bounds: %s"; + msg = "Unable to get zstd compression parameter bounds: %s " + "(error code %llu)"; break; case ERR_GET_D_BOUNDS: - msg = "Unable to get zstd decompression parameter bounds: %s"; + msg = "Unable to get zstd decompression parameter bounds: %s " + "(error code %llu)"; break; case ERR_SET_C_LEVEL: - msg = "Unable to set zstd compression level: %s"; + msg = "Unable to set zstd compression level: %s " + "(error code %llu)"; break; case ERR_TRAIN_DICT: - msg = "Unable to train the Zstandard dictionary: %s"; + msg = "Unable to train the Zstandard dictionary: %s " + "(error code %llu)"; break; case ERR_FINALIZE_DICT: - msg = "Unable to finalize the Zstandard dictionary: %s"; + msg = "Unable to finalize the Zstandard dictionary: %s " + "(error code %llu)"; break; default: Py_UNREACHABLE(); } - PyErr_Format(state->ZstdError, msg, ZSTD_getErrorName(zstd_ret)); + PyErr_Format(state->ZstdError, msg, ZSTD_getErrorName(zstd_ret), + (unsigned long long)zstd_ret); } typedef struct { From 8693c36b8e167f280db9ac3c462eba54b5ea2b71 Mon Sep 17 00:00:00 2001 From: su-213 <3103124410@qq.com> Date: Mon, 13 Jul 2026 11:40:07 +0800 Subject: [PATCH 2/2] gh-153550: Remove out-of-date page-number citations from tkinter docs Remove references to specific page numbers in Ousterhout's book, which refer to a single print edition and are not useful in the online documentation. --- Doc/library/tkinter.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst index 6962528b6a1fcd..9e54f7f35f79af 100644 --- a/Doc/library/tkinter.rst +++ b/Doc/library/tkinter.rst @@ -613,7 +613,7 @@ Packer options ^^^^^^^^^^^^^^ For more extensive information on the packer and the options that it can take, -see the man pages and page 183 of John Ousterhout's book. +see the relevant man pages for details. anchor Anchor type. Denotes where the packer is to place each content in its parcel. @@ -772,7 +772,7 @@ color Colors can be given as the names of X colors in the rgb.txt file, or as strings representing RGB values in 4 bit: ``"#RGB"``, 8 bit: ``"#RRGGBB"``, 12 bit: ``"#RRRGGGBBB"``, or 16 bit: ``"#RRRRGGGGBBBB"`` ranges, where R,G,B here - represent any legal hex digit. See page 160 of Ousterhout's book for details. + represent any legal hex digit. See the Tk documentation for details. cursor The name of the mouse cursor to display while the pointer is over the widget. @@ -856,8 +856,7 @@ sequence ```` form (for example ``""`` or ``""``); application-defined virtual events use double angle brackets, as in ``"<>"``. (See the - :manpage:`bind(3tk)` man page, and page 201 of John Ousterhout's book, - :title-reference:`Tcl and the Tk Toolkit (2nd edition)`, for details). + :manpage:`bind(3tk)` man page for details). func is a Python function, taking one argument, to be invoked when the event occurs.