From b365f44fa1e51e13fadacc8fdf7b14aa1be01452 Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Sat, 29 Oct 2016 11:12:02 -0500 Subject: [PATCH] Simplify surrogate check in to_text() (#18211) * Simplify surrogate check in to_text() * Simplify surrogateescape check even further --- lib/ansible/module_utils/_text.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/ansible/module_utils/_text.py b/lib/ansible/module_utils/_text.py index cf075e3bb44..173bbf4a9d2 100644 --- a/lib/ansible/module_utils/_text.py +++ b/lib/ansible/module_utils/_text.py @@ -173,12 +173,6 @@ def to_text(obj, encoding='utf-8', errors=None, nonstring='simplerepr'): else: errors = 'strict' - if errors is None: - if PY3: - errors = 'surrogateescape' - else: - errors = 'replace' - if isinstance(obj, binary_type): return obj.decode(encoding, errors)