summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2022-04-26 17:45:08 (GMT)
committerGitHub <noreply@github.com>2022-04-26 17:45:08 (GMT)
commit1af871eeee4a01cc21a6960d087e9ab8ce4c9f4d (patch)
treed3f628ac343850c66c60a5c6a0cc92e059f7dc0c
parent4153f2cbcb41a1a9057bfba28d5f65d48ea39283 (diff)
downloadcpython-1af871eeee4a01cc21a6960d087e9ab8ce4c9f4d.zip
cpython-1af871eeee4a01cc21a6960d087e9ab8ce4c9f4d.tar.gz
cpython-1af871eeee4a01cc21a6960d087e9ab8ce4c9f4d.tar.bz2
gh-91217: deprecate telnetlib (GH-91958)
-rw-r--r--Doc/whatsnew/3.11.rst1
-rw-r--r--Lib/telnetlib.py3
-rw-r--r--Lib/test/test_telnetlib.py5
-rw-r--r--Misc/NEWS.d/next/Library/2022-04-17-12-41-52.gh-issue-91217.3wnHSX.rst1
4 files changed, 8 insertions, 2 deletions
diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst
index 8f0d3c7..b812658 100644
--- a/Doc/whatsnew/3.11.rst
+++ b/Doc/whatsnew/3.11.rst
@@ -1069,6 +1069,7 @@ Deprecated
* :mod:`sndhdr`
* :mod:`spwd`
* :mod:`sunau`
+ * :mod:`telnetlib`
(Contributed by Brett Cannon in :issue:`47061`.)
diff --git a/Lib/telnetlib.py b/Lib/telnetlib.py
index ae88ea5..62d6361 100644
--- a/Lib/telnetlib.py
+++ b/Lib/telnetlib.py
@@ -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"]
diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py
index b50df14..a9cade2 100644
--- a/Lib/test/test_telnetlib.py
+++ b/Lib/test/test_telnetlib.py
@@ -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
index 0000000..6c4acc7
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-04-17-12-41-52.gh-issue-91217.3wnHSX.rst
@@ -0,0 +1 @@
+Deprecate the telnetlib module.