Issue 5188: telnetlib process_rawq buffer handling is confused (original) (raw)

Created on 2009-02-08 22:16 by dugan, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
telnetlib.patch dugan,2009-02-13 00:46 Proposed patch
telnetlib.patch dugan,2009-02-15 15:08
Messages (7)
msg81424 - (view) Author: David Christian (dugan) Date: 2009-02-08 22:16
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.
msg81425 - (view) Author: David Christian (dugan) Date: 2009-02-08 22:18
The result of this bug is that any callback set via set_option_negotiation_callback will not be called.
msg82039 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2009-02-14 12:52
b"\021"[0] can be written 0o21 (or 17 or 0x11).
msg82157 - (view) Author: David Christian (dugan) Date: 2009-02-15 15:08
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.
msg84203 - (view) Author: Jack Diederich (jackdied) * (Python committer) Date: 2009-03-26 19:37
I assigned this to me. I'll be sprinting on telnetlib.
msg90726 - (view) Author: LazyLogik (LazyLogik) Date: 2009-07-20 08:07
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
msg90964 - (view) Author: Jack Diederich (jackdied) * (Python committer) Date: 2009-07-26 22:50
between r71434 and r74217 this should be fixed for 3.2. Marking as closed.
History
Date User Action Args
2022-04-11 14:56:45 admin set github: 49438
2009-07-26 22:50:40 jackdied set status: open -> closedresolution: fixedmessages: +
2009-07-20 08:07:54 LazyLogik set nosy: + LazyLogikmessages: +
2009-03-26 22:00:20 vstinner set nosy: - vstinner
2009-03-26 19:38:00 jackdied set assignee: jackdiedmessages: + nosy: + jackdied
2009-02-15 15:09:00 dugan set files: + telnetlib.patch
2009-02-15 15:08:26 dugan set messages: +
2009-02-14 12:52:24 vstinner set nosy: + vstinnermessages: +
2009-02-13 00:46:29 dugan set files: + telnetlib.patchkeywords: + patch
2009-02-08 22🔞40 dugan set messages: +
2009-02-08 22:16:10 dugan create