[Tutor] telnetlib - character hex00 missing

Joachim Roop no.dr at gmx.de
Mon Nov 22 08:28:09 CET 2010


Even though my non-python telnet-server on the other side is sending #00-bytes, they are not recognized by python's telnetlib (characters #01-#FF seem to work fine though).
My C++ implementation has no problems with this.  I have to use Python 3.1 on Windows.

I'm guessing this a known bug. What is the workaround? :(



# Receiver
tn = telnetlib.Telnet()
tn.open(ip, port)

while 1:
  response = (tn.read_until(b"\r",20))[1:-1]
  if response.find(bytes.fromhex("00")) > -1:
    print ("There are hex00 characters")
  else:
    print ("No hex00 characters found")

tn.close
-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail


More information about the Tutor mailing list