in telnetlib's process_rawq, rawq_getchar() returns a bytes object of length 1. However, that buffer is then compared directly against the variable IAC, which is the integer 255. This is always false, as bytes([255]) != 255. Checked svn and looks like this issue still exists as of 2/8/2009.
True. It turns out that there are other uses of a bytes string when a byte is required in that same routine. I've patched up those as well. Looks what we really need is a test of this function. I'll work on that as well.
Hello, I am also facing problems in using telnetlib. I think following changes are also required. e.g. on line 442 (if c!= IAC) should be replaced with (if c!= IAC[0]). Similarly line 465 (if cmd in (DO, DONT)) should be replaced with (if cmd in (DO[0], DONT[0]). I also get some errors while printing debug messages also if debug level is not zero. e.g. Line 466 Regards, Naimesh