This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: telnetlib.Telnet should act as a context manager
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: SilentGhost, gregory.p.smith
Priority: normal Keywords: easy

Created on 2016-04-08 17:44 by gregory.p.smith, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg263031 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2016-04-08 17:44
Telnet instances should support the context manager protocol so they can be used in with statements.

>>> import telnetlib
>>> with telnetlib.Telnet('192.168.86.7') as tn:
...   pass
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: __exit__
msg263035 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-04-08 18:40
issue25485 seem to have addressed this.
msg263040 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2016-04-08 19:25
hah, i should've tested this in an up to date client. :)
History
Date User Action Args
2022-04-11 14:58:29adminsetgithub: 70901
2016-04-08 19:25:36gregory.p.smithsetmessages: + msg263040
2016-04-08 18:40:14SilentGhostsetstatus: open -> closed

nosy: + SilentGhost
messages: + msg263035

resolution: duplicate
stage: resolved
2016-04-08 17:44:51gregory.p.smithcreate