diff options
author | Pavel Zuna <pzuna@redhat.com> | 2010-02-11 15:05:13 +0100 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2010-02-19 14:38:58 -0500 |
commit | 03f16810eebf914ce506031551c8eef84d90ffe6 (patch) | |
tree | 8d616ce6c6f9fec5ae401e0b25febf9725ab0f71 /ipalib | |
parent | 33a30fef121dbbf588a73f55c96e040e60b16c06 (diff) | |
download | freeipa-03f16810eebf914ce506031551c8eef84d90ffe6.tar.gz freeipa-03f16810eebf914ce506031551c8eef84d90ffe6.tar.xz freeipa-03f16810eebf914ce506031551c8eef84d90ffe6.zip |
Use unicode instead of str for environmental variables in Env.
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/config.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ipalib/config.py b/ipalib/config.py index 5311f9904..8597645a4 100644 --- a/ipalib/config.py +++ b/ipalib/config.py @@ -243,7 +243,9 @@ class Env(object): ) assert not hasattr(self, key) if isinstance(value, basestring): - value = str(value.strip()) + value = value.strip() + if isinstance(value, str): + value = value.decode('utf-8') m = { 'True': True, 'False': False, @@ -259,7 +261,7 @@ class Env(object): value = float(value) except (TypeError, ValueError): pass - assert type(value) in (str, int, float, bool, NoneType) + assert type(value) in (unicode, int, float, bool, NoneType) object.__setattr__(self, key, value) self.__d[key] = value |