[issue28661] Fix code example in Python 3.5 telnetlib documentation
New submission from Ivan Tomilov: The code sample on page https://docs.python.org/3/library/telnetlib.html is a little confusing. The extra space in string "Password: " before the second quote basically hangs the example program when you try to run it. Please, check my answer on Stack Overflow for more details: http://stackoverflow.com/questions/28345839/python3-telnet-code-stays-quiet-... I'm sorry if I get something wrong. Thanks, Ivan. ---------- assignee: docs@python components: Documentation messages: 280536 nosy: docs@python, tiabc priority: normal severity: normal status: open title: Fix code example in Python 3.5 telnetlib documentation type: enhancement versions: Python 3.5 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28661> _______________________________________
R. David Murray added the comment: Well, the example code is correct for a typical telnet service running on a unix variant. That will output a space after the colon, so that the user's input is separated from the colon when they start to type. ---------- nosy: +r.david.murray _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28661> _______________________________________
Ivan Tomilov added the comment: I see, thanks for the clarification. But in my OS X the things are different and I spent about 1 hour trying this code to take off. Maybe it's better to change this code to avoid spending time for such subtle bugs? Say: tn.read_until(b"Password:") tn.read_eager() Or just add a comment. It's confusing when one takes code from the official website and it doesn't work. What do you think? On 11 November 2016 at 02:05, R. David Murray <report@bugs.python.org> wrote:
R. David Murray added the comment:
Well, the example code is correct for a typical telnet service running on a unix variant. That will output a space after the colon, so that the user's input is separated from the colon when they start to type.
---------- nosy: +r.david.murray
_______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28661> _______________________________________
---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28661> _______________________________________
R. David Murray added the comment: Hmm. I'm surprised that OSX would be different. I didn't actually experiment to confirm it on linux, either. I could be taken as a "teaching opportunity" to talk about exact match vs read_eager, in a comment before or after the example, if someone wants to propose a doc patch. I'm not opposed to changing the example, but an explanation would probably be good either way. Maybe Jack will have an opinion. ---------- assignee: docs@python -> nosy: +jackdied versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28661> _______________________________________
participants (2)
-
Ivan Tomilov
-
R. David Murray