Skip to content

Commit a542ed4

Browse files
committed
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
1 parent 58ac4fa commit a542ed4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_pytest/compat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,4 @@ def safe_str(v):
240240
if not isinstance(v, unicode):
241241
v = unicode(v)
242242
errors = 'replace'
243-
return v.encode('ascii', errors)
243+
return v.encode('utf-8', errors)

0 commit comments

Comments
 (0)