From cf680c28fe13c6e4d9a4d46d29dccb19963eb865 Mon Sep 17 00:00:00 2001 From: Andrejs Cainikovs Date: Mon, 7 Jan 2019 14:21:17 +0100 Subject: [PATCH] Ignore chars which cannot be encoded More info in #14 --- valve/rcon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/valve/rcon.py b/valve/rcon.py index ccd808f..39fd0a2 100644 --- a/valve/rcon.py +++ b/valve/rcon.py @@ -139,7 +139,7 @@ def text(self, text): :raises UnicodeEncodeError: if the string cannot be encoded as ASCII. """ - self.body = text.encode(self.ENCODING) + self.body = text.encode(encoding=self.ENCODING, errors='ignore') def encode(self): """Encode message to a bytestring."""