From 1fa6b3fd31a65e70514e6d1a38a742df5898599a Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Thu, 5 Oct 2017 21:02:12 +0300 Subject: [PATCH] amodem: fix str/bytes handling --- plugins/audio_modem/qt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/audio_modem/qt.py b/plugins/audio_modem/qt.py index 2f1d36325..254988b9a 100644 --- a/plugins/audio_modem/qt.py +++ b/plugins/audio_modem/qt.py @@ -103,7 +103,7 @@ class Plugin(BasePlugin): amodem.main.send(config=self.modem_config, src=src, dst=dst) print_msg('Sending:', repr(blob)) - blob = zlib.compress(blob) + blob = zlib.compress(blob.encode('ascii')) kbps = self.modem_config.modem_bps / 1e3 msg = 'Sending to Audio MODEM ({0:.1f} kbps)...'.format(kbps) @@ -119,7 +119,7 @@ class Plugin(BasePlugin): def on_finished(blob): if blob: - blob = zlib.decompress(blob) + blob = zlib.decompress(blob).decode('ascii') print_msg('Received:', repr(blob)) parent.setText(blob)