From 15a9762500b3d9a13206aa54d8695513efaf3b55 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Tue, 16 Dec 2025 11:52:20 +0300 Subject: [PATCH 1/3] gh-142595: Amend be5e0dcdedb (fix NULL pointer dereference) (GH-142775) --- Modules/_decimal/_decimal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index 6ed8c0f3beb277..e183c70653b0d4 100644 --- a/Modules/_decimal/_decimal.c +++ b/Modules/_decimal/_decimal.c @@ -7753,8 +7753,9 @@ _decimal_exec(PyObject *m) /* DecimalTuple */ ASSIGN_PTR(collections, PyImport_ImportModule("collections")); - obj = PyObject_CallMethod(collections, "namedtuple", "(ss)", "DecimalTuple", - "sign digits exponent"); + ASSIGN_PTR(obj, PyObject_CallMethod(collections, "namedtuple", "(ss)", + "DecimalTuple", + "sign digits exponent")); if (!PyType_Check(obj)) { PyErr_SetString(PyExc_TypeError, "type is expected from namedtuple call"); From a44509ea87021f78a9f769aff2bb3fc212bc8afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20S=C5=82awecki?= Date: Tue, 16 Dec 2025 11:15:37 +0100 Subject: [PATCH 2/3] gh-139320: Cover exception chaining in the docs of `contextmanager.__exit__` (GH-140169) --- Doc/library/stdtypes.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index a0b78f8053764b..5cfa888706f9b9 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -5475,9 +5475,11 @@ before the statement body is executed and exited when the statement ends: Returning a true value from this method will cause the :keyword:`with` statement to suppress the exception and continue execution with the statement immediately following the :keyword:`!with` statement. Otherwise the exception continues - propagating after this method has finished executing. Exceptions that occur - during execution of this method will replace any exception that occurred in the - body of the :keyword:`!with` statement. + propagating after this method has finished executing. + + If this method raises an exception while handling an earlier exception from the + :keyword:`with` block, the new exception is raised, and the original exception + is stored in its :attr:`~BaseException.__context__` attribute. The exception passed in should never be reraised explicitly - instead, this method should return a false value to indicate that the method completed From 58027999bf7491238a2e6393c93b73e5f265f160 Mon Sep 17 00:00:00 2001 From: Patrick R Date: Tue, 16 Dec 2025 12:21:38 +0100 Subject: [PATCH 3/3] gh-124864: Extends smtplib documentation on ESMTP options format (#132547) --- Doc/library/smtplib.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Doc/library/smtplib.rst b/Doc/library/smtplib.rst index 3ee8b82a1880f3..3bf5ec6099facb 100644 --- a/Doc/library/smtplib.rst +++ b/Doc/library/smtplib.rst @@ -458,9 +458,11 @@ An :class:`SMTP` instance has the following methods: Send mail. The required arguments are an :rfc:`822` from-address string, a list of :rfc:`822` to-address strings (a bare string will be treated as a list with 1 address), and a message string. The caller may pass a list of ESMTP options - (such as ``8bitmime``) to be used in ``MAIL FROM`` commands as *mail_options*. + (such as ``"8bitmime"``) to be used in ``MAIL FROM`` commands as *mail_options*. ESMTP options (such as ``DSN`` commands) that should be used with all ``RCPT`` - commands can be passed as *rcpt_options*. (If you need to use different ESMTP + commands can be passed as *rcpt_options*. Each option should be passed as a string + containing the full text of the option, including any potential key + (for instance, ``"NOTIFY=SUCCESS,FAILURE"``). (If you need to use different ESMTP options to different recipients you have to use the low-level methods such as :meth:`!mail`, :meth:`!rcpt` and :meth:`!data` to send the message.)