1
0
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:
Dan O'Reilly
2009-01-17 12:58:02 -05:00
parent 4f22df62b0
commit 75219d78c4
3 changed files with 15 additions and 12 deletions

View File

@@ -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')