From: Serhiy Storchaka Date: Fri, 26 Apr 2024 05:53:54 +0000 (+0300) Subject: [3.12] gh-118042: Fix error in Telnet.__del__ when __init__() was not called (GH... X-Git-Tag: v3.12.4~170 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8e3bd342f39d9904ee48065446562db3f1d66e61;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-118042: Fix error in Telnet.__del__ when __init__() was not called (GH-118274) --- diff --git a/Lib/telnetlib.py b/Lib/telnetlib.py index 62d636129853..af44494e7e87 100644 --- a/Lib/telnetlib.py +++ b/Lib/telnetlib.py @@ -195,6 +195,7 @@ class Telnet: No other action is done afterwards by telnetlib. """ + sock = None # for __del__() def __init__(self, host=None, port=0, timeout=socket._GLOBAL_DEFAULT_TIMEOUT): diff --git a/Misc/NEWS.d/next/Library/2024-04-25-12-02-06.gh-issue-118042.2EcdHf.rst b/Misc/NEWS.d/next/Library/2024-04-25-12-02-06.gh-issue-118042.2EcdHf.rst new file mode 100644 index 000000000000..7337aae0981e --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-04-25-12-02-06.gh-issue-118042.2EcdHf.rst @@ -0,0 +1,2 @@ +Fix an unraisable exception in :meth:`telnetlib.Telnet.__del__` when the +``__init__()`` method was not called.