[issue25485] Add a context manager to telnetlib.Telnet

2015-11-28 Thread R. David Murray
R. David Murray added the comment: Thanks, Stéphane. I adjusted the docs...we don't seem to be very consistent about how we document addition of content manager support, so I picked what I liked best. Also, FYI it is generally best (at this point in time) to not include the NEWS item, but

[issue25485] Add a context manager to telnetlib.Telnet

2015-11-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 277824f2d133 by R David Murray in branch 'default': #25485: Add context manager support to Telnet class. https://hg.python.org/cpython/rev/277824f2d133 -- nosy: +python-dev ___ Python tracker

[issue25485] Add a context manager to telnetlib.Telnet

2015-11-21 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: I applied the recommendation of SilentGhost for this issue. Need review Thank you -- Added file: http://bugs.python.org/file41119/issue25485-4.patch ___ Python tracker

[issue25485] Add a context manager to telnetlib.Telnet

2015-11-20 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Need review for this new patch. * Add test * Improve the documentation * Update the Misc/NEWS -- Added file: http://bugs.python.org/file41106/issue25485-3.patch ___ Python tracker

[issue25485] Add a context manager to telnetlib.Telnet

2015-11-17 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Should I develop a mock telnet server for the unittest ? -- ___ Python tracker ___

[issue25485] Add a context manager to telnetlib.Telnet

2015-11-17 Thread R. David Murray
R. David Murray added the comment: The existing tests seem to have at least some infrastructure that would apply here, so figuring out how to use/extend that is better than writing new code, I'd say. -- nosy: +r.david.murray ___ Python tracker

[issue25485] Add a context manager to telnetlib.Telnet

2015-10-30 Thread SilentGhost
SilentGhost added the comment: That's fine as a code change, but that's not the kind of test I meant. There is a Lib/test/test_ftplib.py and it basically needs test_with_statement added to one or few test cases. Have a look at how the similar functions implemented in Lib/test/. --

[issue25485] Add a context manager to telnetlib.Telnet

2015-10-30 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: New version of the patch, I have modified the 'test' function. In this function, I use the with statement with the __enter__ and __exit__. -- Added file: http://bugs.python.org/file40902/issue25485-2.patch ___

[issue25485] Add a context manager to telnetlib.Telnet

2015-10-30 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Ok i will submit an other patch for the tests and the documentation > On 30 oct. 2015, at 4:37 PM, SilentGhost wrote: > > > SilentGhost added the comment: > > That's fine as a code change, but that's not the kind of test I meant.

[issue25485] Add a context manager to telnetlib.Telnet

2015-10-28 Thread Berker Peksag
Berker Peksag added the comment: This seems like a reasonable request to me. See https://docs.python.org/devguide/ to learn how to contribute to Python. -- nosy: +berker.peksag stage: -> needs patch ___ Python tracker

[issue25485] Add a context manager to telnetlib.Telnet

2015-10-28 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: totally agree, I will work on this issue tomorrow -- ___ Python tracker ___

[issue25485] Add a context manager to telnetlib.Telnet

2015-10-28 Thread desbma
desbma added the comment: I was actually writing a patch with a test, but since Stéphane beat me to it, I'll let him do the job :) -- ___ Python tracker

[issue25485] Add a context manager to telnetlib.Telnet

2015-10-28 Thread SilentGhost
SilentGhost added the comment: This probably needs test -- nosy: +SilentGhost ___ Python tracker ___ ___

[issue25485] Add a context manager to telnetlib.Telnet

2015-10-28 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Here is a small patch -- keywords: +patch nosy: +matrixise Added file: http://bugs.python.org/file40879/issue25485.patch ___ Python tracker

[issue25485] Add a context manager to telnetlib.Telnet

2015-10-28 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Maybe, modify the documentation or improve the current examples. -- ___ Python tracker ___

[issue25485] Add a context manager to telnetlib.Telnet

2015-10-26 Thread desbma
New submission from desbma: telnetlib.Telnet could have a context manager to call close() automatically. I can provide a patch if the idea is approved, although I have never contributed to Python. -- components: Library (Lib) messages: 253489 nosy: desbma priority: normal severity: