From f1a8c0b0e6fba4c362aedc7ce1930d61e72928ce Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sun, 19 Feb 2017 15:52:22 +0100 Subject: [PATCH] misc. fixes for python3 --- gui/qt/main_window.py | 2 +- gui/qt/util.py | 2 +- lib/exchange_rate.py | 2 +- plugins/audio_modem/qt.py | 2 +- plugins/labels/labels.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 04ee8457..e968d07b 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -1224,7 +1224,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): menu.exec_(self.from_list.viewport().mapToGlobal(position)) def set_pay_from(self, coins): - self.pay_from = coins + self.pay_from = list(coins) self.redraw_from_list() def redraw_from_list(self): diff --git a/gui/qt/util.py b/gui/qt/util.py index ac916abd..d9ead197 100644 --- a/gui/qt/util.py +++ b/gui/qt/util.py @@ -470,7 +470,7 @@ class MyTreeWidget(QTreeWidget): def on_edited(self, item, column, prior): '''Called only when the text actually changes''' - key = str(item.data(0, Qt.UserRole).toString()) + key = item.data(0, Qt.UserRole) text = item.text(column) self.parent.wallet.set_label(key, text) self.parent.history_list.update_labels() diff --git a/lib/exchange_rate.py b/lib/exchange_rate.py index c6973ebf..ec61730c 100644 --- a/lib/exchange_rate.py +++ b/lib/exchange_rate.py @@ -46,7 +46,7 @@ class ExchangeBase(PrintError): def get_csv(self, site, get_string): url = ''.join(['https://', site, get_string]) response = requests.request('GET', url, headers={'User-Agent' : 'Electrum'}) - reader = csv.DictReader(response.content.split('\n')) + reader = csv.DictReader(response.content.decode().split('\n')) return list(reader) def name(self): diff --git a/plugins/audio_modem/qt.py b/plugins/audio_modem/qt.py index 6e59f007..3e23f535 100644 --- a/plugins/audio_modem/qt.py +++ b/plugins/audio_modem/qt.py @@ -57,7 +57,7 @@ class Plugin(BasePlugin): self.modem_config = amodem.config.bitrates[bitrate] combo = QComboBox() - combo.addItems(map(str, bitrates)) + combo.addItems([str(x) for x in bitrates]) combo.currentIndexChanged.connect(_index_changed) layout.addWidget(combo, 0, 1) diff --git a/plugins/labels/labels.py b/plugins/labels/labels.py index d9c25a37..3e435a13 100644 --- a/plugins/labels/labels.py +++ b/plugins/labels/labels.py @@ -23,7 +23,7 @@ class LabelsPlugin(BasePlugin): password, iv, wallet_id = self.wallets[wallet] encrypted = electrum.bitcoin.aes_encrypt_with_iv(password, iv, msg.encode('utf8')) - return base64.b64encode(encrypted) + return base64.b64encode(encrypted).decode() def decode(self, wallet, message): password, iv, wallet_id = self.wallets[wallet]