mirror of
https://github.com/gryf/wicd.git
synced 2026-01-09 07:14:13 +01:00
Fix bug where encryption keys with non-ascii characters caused crashes.
Only write settings being saved if debug mode is on. Clear keys entered through the GUI when the encryption checkbox is disabled.
This commit is contained in:
@@ -318,7 +318,7 @@ def get_gettext():
|
||||
def to_unicode(x):
|
||||
""" Attempts to convert a string to utf-8. """
|
||||
# If this is a unicode string, encode it and return
|
||||
if type(x) not in [unicode, str]:
|
||||
if not isinstance(x, basestring):
|
||||
return x
|
||||
if isinstance(x, unicode):
|
||||
return x.encode('utf-8')
|
||||
|
||||
Reference in New Issue
Block a user