Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-91217: deprecate telnetlib #91958

Merged
merged 3 commits into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,7 @@ Deprecated
* :mod:`sndhdr`
* :mod:`spwd`
* :mod:`sunau`
* :mod:`telnetlib`

(Contributed by Brett Cannon in :issue:`47061`.)

Expand Down
3 changes: 3 additions & 0 deletions Lib/telnetlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
import socket
import selectors
from time import monotonic as _time
import warnings

warnings._deprecated(__name__, remove=(3, 13))

__all__ = ["Telnet"]

Expand Down
5 changes: 3 additions & 2 deletions Lib/test/test_telnetlib.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate the telnetlib module.