From 7a6fd1a1aa1ad39a401887619c33cb49e55adfea Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 31 Oct 2021 13:40:11 -0400 Subject: [PATCH] console: Use regular str() types for commands on Python2 Avoid using unicode() types on Python2 as it can lead to subtle errors. Signed-off-by: Kevin O'Connor --- klippy/console.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/klippy/console.py b/klippy/console.py index b3075912..bb91a883 100755 --- a/klippy/console.py +++ b/klippy/console.py @@ -187,7 +187,7 @@ class KeyboardReader: return None return line def process_kbd(self, eventtime): - self.data += os.read(self.fd, 4096).decode() + self.data += str(os.read(self.fd, 4096).decode()) kbdlines = self.data.split('\n') for line in kbdlines[:-1]: