Fix 8-bit Telnet with Py3K
[mudpy.git] / lib / mudpy / misc.py
index bf107a4..b3f2e25 100644 (file)
@@ -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"):
@@ -2055,11 +2054,11 @@ def command_say(actor, parameters):
     if message:
 
         # match the punctuation used, if any, to an action
-        actions = universe.categories["internal"]["language"].get(
+        actions = universe.contents["mudpy.linguistic"].get(
             "actions"
         )
         default_punctuation = (
-            universe.categories["internal"]["language"].get(
+            universe.contents["mudpy.linguistic"].get(
                 "default_punctuation"))
         action = ""
 
@@ -2084,7 +2083,7 @@ def command_say(actor, parameters):
             message = message[0].lower() + message[1:]
 
             # iterate over all words in message, replacing typos
-            typos = universe.categories["internal"]["language"].get(
+            typos = universe.contents["mudpy.linguistic"].get(
                 "typos"
             )
             words = message.split()