]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-91217: deprecate telnetlib (GH-91958)
authorBrett Cannon <brett@python.org>
Tue, 26 Apr 2022 17:45:08 +0000 (10:45 -0700)
committerGitHub <noreply@github.com>
Tue, 26 Apr 2022 17:45:08 +0000 (10:45 -0700)
Doc/whatsnew/3.11.rst
Lib/telnetlib.py
Lib/test/test_telnetlib.py
Misc/NEWS.d/next/Library/2022-04-17-12-41-52.gh-issue-91217.3wnHSX.rst [new file with mode: 0644]

index 8f0d3c7c7099a37063f28b9f070f45087970618f..b812658d5e91e8f843d7dac6bbc85494954a8e94 100644 (file)
@@ -1069,6 +1069,7 @@ Deprecated
   * :mod:`sndhdr`
   * :mod:`spwd`
   * :mod:`sunau`
+  * :mod:`telnetlib`
 
   (Contributed by Brett Cannon in :issue:`47061`.)
 
index ae88ea594746fd8512ab7c63d47da31c2cff6f05..62d636129853ad14bf63371f54d70bb06455f636 100644 (file)
@@ -37,6 +37,9 @@ import sys
 import socket
 import selectors
 from time import monotonic as _time
+import warnings
+
+warnings._deprecated(__name__, remove=(3, 13))
 
 __all__ = ["Telnet"]
 
index b50df1459d1f4c3d11f248b5901b3cfabfa3f206..a9cade2ee466f991dbb762692d646c7d5e5ae759 100644 (file)
@@ -1,15 +1,16 @@
 import socket
 import selectors
-import telnetlib
 import threading
 import contextlib
 
 from test import support
-from test.support import socket_helper
+from test.support import socket_helper, warnings_helper
 import unittest
 
 support.requires_working_socket(module=True)
 
+telnetlib = warnings_helper.import_deprecated('telnetlib')
+
 HOST = socket_helper.HOST
 
 def server(evt, serv):
diff --git a/Misc/NEWS.d/next/Library/2022-04-17-12-41-52.gh-issue-91217.3wnHSX.rst b/Misc/NEWS.d/next/Library/2022-04-17-12-41-52.gh-issue-91217.3wnHSX.rst
new file mode 100644 (file)
index 0000000..6c4acc7
--- /dev/null
@@ -0,0 +1 @@
+Deprecate the telnetlib module.