From 6dcb4941df815383c118250e2eee05a8b56db958 Mon Sep 17 00:00:00 2001 From: David Paleino Date: Thu, 3 May 2012 18:01:49 +0200 Subject: [PATCH] Fix translation of dbus.String --- wicd/misc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wicd/misc.py b/wicd/misc.py index 8889f74..4fcfee3 100644 --- a/wicd/misc.py +++ b/wicd/misc.py @@ -430,7 +430,10 @@ def sanitize_config(s): """ Sanitize property names to be used in config-files. """ allowed = string.ascii_letters + '_' + string.digits table = string.maketrans(allowed, ' ' * len(allowed)) - return s.translate(None, table) + + # s is a dbus.String -- since we don't allow unicode property keys, + # make it simple. + return str(s).translate(None, table) def sanitize_escaped(s): """ Sanitize double-escaped unicode strings. """