Pass proper error value to to_text (#33030)

pull/33033/head
Sam Doran 7 years ago committed by GitHub
parent 2ef438c962
commit 1980c9e773
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -370,7 +370,7 @@ class CloudflareAPI(object):
if content:
try:
result = json.loads(to_text(content, errors='surrogate_then_strict'))
result = json.loads(to_text(content, errors='surrogate_or_strict'))
except (json.JSONDecodeError, UnicodeError) as e:
error_msg += "; Failed to parse API response with error {0}: {1}".format(to_native(e), content)

Loading…
Cancel
Save