From: Jeremy Stanley Date: Tue, 28 Jun 2016 06:50:50 +0000 (+0000) Subject: Fix 8-bit Telnet with Py3K X-Git-Tag: 0.0.1~186 X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=commitdiff_plain;h=381d70d0d1d4b80e89acc46435031ed9c9547374;ds=sidebyside 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"):