From a542ed48a23cfbc526a1876ec135d4e43b37a38f Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 29 Mar 2017 15:18:41 -0300 Subject: [PATCH] Convert using utf-8 instead of ascii in safe_str() This way we don't lose information and the returned string is ascii-compatible anyway --- _pytest/compat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_pytest/compat.py b/_pytest/compat.py index cc2954bff..4f2013dac 100644 --- a/_pytest/compat.py +++ b/_pytest/compat.py @@ -240,4 +240,4 @@ else: if not isinstance(v, unicode): v = unicode(v) errors = 'replace' - return v.encode('ascii', errors) + return v.encode('utf-8', errors)