This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: telnetlib process_rawq buffer handling is confused
Type: Stage:
Components: Versions: Python 3.0, Python 3.1
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jackdied Nosy List: LazyLogik, dugan, jackdied
Priority: normal Keywords: patch

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

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

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

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.
Date User Action Args
2022-04-11 14:56:45adminsetgithub: 49438
2009-07-26 22:50:40jackdiedsetstatus: open -> closed
resolution: fixed
messages: + msg90964
2009-07-20 08:07:54LazyLogiksetnosy: + LazyLogik
messages: + msg90726
2009-03-26 22:00:20vstinnersetnosy: - vstinner
2009-03-26 19:38:00jackdiedsetassignee: jackdied

messages: + msg84203
nosy: + jackdied
2009-02-15 15:09:00dugansetfiles: + telnetlib.patch
2009-02-15 15:08:26dugansetmessages: + msg82157
2009-02-14 12:52:24vstinnersetnosy: + vstinner
messages: + msg82039
2009-02-13 00:46:29dugansetfiles: + telnetlib.patch
keywords: + patch
2009-02-08 22:18:40dugansetmessages: + msg81425
2009-02-08 22:16:10dugancreate