From: Jeremy Stanley Date: Tue, 28 Jun 2016 06:50:50 +0000 (+0000) Subject: Fix 8-bit Telnet with Py3K X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=commitdiff_plain;h=c9b5c23e83edea14c3dee8a0ff9dc9c89dc8f9cd Fix 8-bit Telnet with Py3K Replace the lambda filter for non-ASCII characters with a list comprehension, correcting and simplifying the range comparison and recombination of the filtered string. --- diff --git a/lib/mudpy/misc.py b/lib/mudpy/misc.py index c0845c5..b3f2e25 100644 --- a/lib/mudpy/misc.py +++ b/lib/mudpy/misc.py @@ -908,8 +908,7 @@ class User: # log non-printable characters remaining if mudpy.telnet.is_enabled(self, mudpy.telnet.TELOPT_BINARY, mudpy.telnet.HIM): - asciiline = b"".join( - filter(lambda x: b" " <= x <= b"~", line)) + asciiline = bytes([x for x in line if 32 <= x <= 126]) if line != asciiline: logline = "Non-ASCII characters from " if self.account and self.account.get("name"):