diff options
author | Petr Viktorin <pviktori@redhat.com> | 2015-09-17 18:46:14 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2015-10-22 18:34:46 +0200 |
commit | 8a2b65a35731470da0befeb01a4e863d782f0e6f (patch) | |
tree | c334d611ce5c702577345ec199086af6f59aa576 /ipalib | |
parent | 0a23afeab2bcba2d2694281cfc558f2821821f59 (diff) | |
download | freeipa-8a2b65a35731470da0befeb01a4e863d782f0e6f.tar.gz freeipa-8a2b65a35731470da0befeb01a4e863d782f0e6f.tar.xz freeipa-8a2b65a35731470da0befeb01a4e863d782f0e6f.zip |
Fix more bytes/unicode issues
Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/config.py | 2 | ||||
-rw-r--r-- | ipalib/rpc.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/ipalib/config.py b/ipalib/config.py index 92a3235f5..44dedf294 100644 --- a/ipalib/config.py +++ b/ipalib/config.py @@ -244,7 +244,7 @@ class Env(object): assert not hasattr(self, key) if isinstance(value, six.string_types): value = value.strip() - if isinstance(value, str): + if isinstance(value, bytes): value = value.decode('utf-8') m = { 'True': True, diff --git a/ipalib/rpc.py b/ipalib/rpc.py index 5b596b601..6a7f6982b 100644 --- a/ipalib/rpc.py +++ b/ipalib/rpc.py @@ -224,7 +224,7 @@ def xml_unwrap(value, encoding='UTF-8'): return dict( (k, xml_unwrap(v, encoding)) for (k, v) in value.items() ) - if type(value) is str: + if isinstance(value, bytes): return value.decode(encoding) if isinstance(value, Binary): assert type(value.data) is bytes @@ -363,7 +363,7 @@ def json_decode_binary(val): def decode_fault(e, encoding='UTF-8'): assert isinstance(e, Fault) - if type(e.faultString) is str: + if isinstance(e.faultString, bytes): return Fault(e.faultCode, e.faultString.decode(encoding)) return e |