diff --git a/printrun/printcore.py b/printrun/printcore.py index b51d9e9bb..38282416d 100644 --- a/printrun/printcore.py +++ b/printrun/printcore.py @@ -250,7 +250,7 @@ def reset(self): def _readline(self): try: try: - line = self.printer.readline() + line = self.printer.readline().decode('ascii') if self.printer_tcp and not line: raise OSError(-1, "Read EOF from socket") except socket.timeout: @@ -658,7 +658,7 @@ def _send(self, command, lineno = 0, calcchecksum = False): try: self.sendcb(command, gline) except: self.logError(traceback.format_exc()) try: - self.printer.write(str(command + "\n")) + self.printer.write((command + "\n").encode('ascii')) if self.printer_tcp: try: self.printer.flush()