From b84888356f36211fe740aaeaa4030cf7a5cc551f Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sun, 31 Dec 2017 22:13:39 -0800 Subject: [PATCH] Don't decode http response content --- plexpy/http_handler.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plexpy/http_handler.py b/plexpy/http_handler.py index 3eab6078..965b262c 100644 --- a/plexpy/http_handler.py +++ b/plexpy/http_handler.py @@ -149,17 +149,17 @@ class HTTPHandler(object): logger.warn(u"Failed to access uri endpoint %s. Status code %r" % (self.uri, response_status)) return None - def _http_format_output(self, response_content, response_headers): + def _http_format_output(self, response_content, response_headers): """Formats the request response to the desired type""" try: if self.output_format == 'text': output = response_content.decode('utf-8', 'ignore') if self.output_format == 'dict': - output = helpers.convert_xml_to_dict(response_content.decode('utf-8', 'ignore')) + output = helpers.convert_xml_to_dict(response_content) elif self.output_format == 'json': - output = helpers.convert_xml_to_json(response_content.decode('utf-8', 'ignore')) + output = helpers.convert_xml_to_json(response_content) elif self.output_format == 'xml': - output = helpers.parse_xml(response_content.decode('utf-8', 'ignore')) + output = helpers.parse_xml(response_content) else: output = response_content