Fixed an issue where improper substitution would cause extra newline

characters for MCCP clients. This made them effectively press return twice
on each command.
This commit is contained in:
Kelketek 2012-06-12 17:51:10 -05:00
parent 98a5f11159
commit 9290cf2c0c

View file

@ -108,7 +108,7 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
def _write(self, data):
"hook overloading the one used in plain telnet"
#print "_write (%s): %s" % (self.state, " ".join(str(ord(c)) for c in data))
data = data.replace('\n', '\r\n')
data = data.rstrip('\r\n') + '\r\n'
super(TelnetProtocol, self)._write(mccp_compress(self, data))
def sendLine(self, line):