diff --git a/lib/ansible/modules/net_tools/cloudflare_dns.py b/lib/ansible/modules/net_tools/cloudflare_dns.py index a5c9475ec8d..e2ee91c854a 100644 --- a/lib/ansible/modules/net_tools/cloudflare_dns.py +++ b/lib/ansible/modules/net_tools/cloudflare_dns.py @@ -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)