mirror of
https://github.com/nicolargo/glances.git
synced 2025-01-04 07:34:49 +03:00
Fix crash in browser mode with Python 3
The crash occurs while trying to unlock a password protected Glances server (TypeError: Unicode-objects must be encoded before hashing).
This commit is contained in:
parent
ccb1751be0
commit
76cdd091eb
@ -163,7 +163,7 @@ class GlancesClientBrowser(object):
|
||||
# Display a popup to enter password
|
||||
clear_password = self.screen.display_popup(_("Password needed for %s: " % v['name']), is_input=True)
|
||||
# Hash with SHA256
|
||||
encoded_password = sha256(clear_password).hexdigest()
|
||||
encoded_password = sha256(clear_password.encode('utf-8')).hexdigest()
|
||||
# Store the password for the selected server
|
||||
self.set_in_selected('password', encoded_password)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user