Telnet linebreaks

Patrick M. Nielsen thirsteh at
Wed May 24 00:48:08 CEST 2006

Hey guys.

I have begun playing with the Simple MUD server example from the Stackless
( )
and it's all good so far, however, I've come to notice something that I
remember from back
in the days (some old mud code), but I don't remember what I did to fix it.

While the MUD reads lines from Telnet clients just fine, clients such as
Gmud are practically ignored,
probably because Gmud doesn't send Telnet-valid data ('\x08'?).

However, a MUD that is not accessible to one such client or others isn't
much good, so I'd appreciate
some help in pinpointing the problem.

These are the code blocks that need modification (I believe)

    def read(self): # TELNET
        ret = self.readChannel.receive()
        if self.echo:
            if ret == '\x08':
                self.send(ret+" ")
        return ret

    def readline(self): # TELNET
        buf = self.readBuffer

        while True:
            if buf.find('\r\n') > -1: # MUD clients that aren't using the
telnet protocol
                i = buf.index('\r\n') # need to be able to do stuff.
                ret = buf[:i+2]
                self.readBuffer = buf[i+2:]
                while '\x08' in ret:
                    i = ret.index('\x08')
                    if i == 0:
                        ret = ret[1:]
                        ret = ret[:i-1]+ret[i+1:]
                return ret

            buf +=

I'm suspecting that Gmud doesn't send '\x08', since from looking at some old
DIKU code,
I see that the if '\n' || '\r' are there as well, but there is no check for
'\x08'. If this is indeed
the cause of my problem, how would I go about doing it?

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list