From 381d70d0d1d4b80e89acc46435031ed9c9547374 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Tue, 28 Jun 2016 06:50:50 +0000 Subject: [PATCH 1/1] 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. --- lib/mudpy/misc.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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"): -- 2.11.0