diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index caa293f7..cc7eabac 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -11,6 +11,7 @@ - fix: ensure converted python file in utf-8 encoding - fix: duplicate running referenced testcase - fix: ensure compatibility issues between testcase format v2 and v3 +- fix: UnicodeDecodeError when request body in protobuf ## 3.0.5 (2020-05-22) diff --git a/httprunner/client.py b/httprunner/client.py index f5474ce3..54f168e1 100644 --- a/httprunner/client.py +++ b/httprunner/client.py @@ -45,7 +45,7 @@ def get_req_resp_record(resp_obj: Response) -> ReqRespData: request_body = resp_obj.request.body try: request_body = json.loads(request_body) - except json.JSONDecodeError: + except (json.JSONDecodeError, UnicodeDecodeError): pass if request_body: