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 2016-04-08 19:25 by gregory.p.smith. 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
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