From eaaf09833dc74dd91ffc6c0c1b131c89b2af6fc6 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Thu, 31 May 2018 00:53:32 +0800 Subject: [PATCH] fix compatibility for python 3.4, 3.5 --- httprunner/response.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/httprunner/response.py b/httprunner/response.py index b40dc55e..34e42073 100644 --- a/httprunner/response.py +++ b/httprunner/response.py @@ -93,6 +93,8 @@ class ResponseObject(object): if not isinstance(top_query_content, (dict, CaseInsensitiveDict, list)): try: # TODO: remove compatibility for content, text + if isinstance(top_query_content, bytes): + top_query_content = top_query_content.decode("utf-8") top_query_content = json.loads(top_query_content) except json.decoder.JSONDecodeError: err_msg = u"Failed to extract data with delimiter!\n"