diff --git a/pyghmi/util/webclient.py b/pyghmi/util/webclient.py index 3f632c4c..6d7f2201 100644 --- a/pyghmi/util/webclient.py +++ b/pyghmi/util/webclient.py @@ -253,8 +253,11 @@ class SecureHTTPConnection(httplib.HTTPConnection, object): # gzip pass if rsp.status >= 200 and rsp.status < 300: - if body and not isinstance(body, str): - body = body.decode('utf8') + if body and not isinstance(body, type(u'')): + try: + body = body.decode('utf8') + except Exception: + body = body.decode('iso-8859-1') return json.loads(body) if body else {}, rsp.status return body, rsp.status