From 0b39b529ddbdbb46362812599cb2b278726db57f Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Thu, 18 Oct 2018 16:27:00 +0100 Subject: [PATCH] [PY3] Fix tray password encoding issue The tray password need to be in bytes but GTK on Py3 returns unicode. Use decode_bytes and then encode to ensure Py2/3 compatibility. --- deluge/ui/gtk3/mainwindow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deluge/ui/gtk3/mainwindow.py b/deluge/ui/gtk3/mainwindow.py index 9f4b77b0f..b380c5a82 100644 --- a/deluge/ui/gtk3/mainwindow.py +++ b/deluge/ui/gtk3/mainwindow.py @@ -19,7 +19,7 @@ from twisted.internet import reactor from twisted.internet.error import ReactorNotRunning import deluge.component as component -from deluge.common import fspeed, resource_filename +from deluge.common import decode_bytes, fspeed, resource_filename from deluge.configmanager import ConfigManager from deluge.ui.client import client @@ -179,7 +179,7 @@ class MainWindow(component.Component): if response_id == Gtk.ResponseType.OK: if ( self.config['tray_password'] - == sha(dialog.get_password()).hexdigest() + == sha(decode_bytes(dialog.get_password()).encode()).hexdigest() ): restore()