[issue29621] telnetlib.Telnet.write gives confusing error message when a string is passed in

2017-05-04 Thread Berker Peksag
Berker Peksag added the comment: I agree with David. The documentation of the method starts with "Write a byte string to the socket [...]" and the example at https://docs.python.org/3/library/telnetlib.html#telnet-example is pretty clear. -- nosy: +berker.peksag resolution: -> rejecte

[issue29621] telnetlib.Telnet.write gives confusing error message when a string is passed in

2017-04-27 Thread Dong-hee Na
Changes by Dong-hee Na : -- pull_requests: -1429 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue29621] telnetlib.Telnet.write gives confusing error message when a string is passed in

2017-04-27 Thread Dong-hee Na
Dong-hee Na added the comment: Thanks for the response. I agree with you. :) -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue29621] telnetlib.Telnet.write gives confusing error message when a string is passed in

2017-04-27 Thread R. David Murray
R. David Murray added the comment: We generally don't do this kind of type checking in the standard library. The message may not be clear, but it is accurate and decipherable, especially given the fact that the write parameter name is 'buffer'. I don't think anything should be done here. If

[issue29621] telnetlib.Telnet.write gives confusing error message when a string is passed in

2017-04-27 Thread Dong-hee Na
Dong-hee Na added the comment: I submitted PR to handle this issue like this way. tn.write([b'data sample without IAC']) File "/Users/corona10/cpython/Lib/telnetlib.py", line 288, in write raise TypeError('%s must be a bytes-like type.' % buffer) TypeError: [b'data sample without IAC'] must

[issue29621] telnetlib.Telnet.write gives confusing error message when a string is passed in

2017-04-27 Thread Dong-hee Na
Changes by Dong-hee Na : -- pull_requests: +1429 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue29621] telnetlib.Telnet.write gives confusing error message when a string is passed in

2017-02-22 Thread John Hagen
New submission from John Hagen: I was recently helping someone learn Python 3 from Python 2 and they were confused by error resulting from the following easy-to-make mistake: import telnetlib tn = telnetlib.Telnet('localhost') tn.write('hello') Traceback (most recent call last): File "/User