mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-23 01:40:08 +00:00
[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.
This commit is contained in:
parent
1d0e40c66b
commit
0b39b529dd
@ -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()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user