From 09556d5fbc71d6280d26c43cc9a99dfa02185567 Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Fri, 18 Jan 2019 20:33:02 +0100 Subject: [PATCH] 'backslashreplace' makes no sense for str.decode() --- strutil.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strutil.py b/strutil.py index 33e3f30..ee464c9 100644 --- a/strutil.py +++ b/strutil.py @@ -42,13 +42,13 @@ if sys.hexversion >= 0x3000000: def b2str(s, enc=None): """Convert a Bytes string to native Python 3 str.""" return s.decode(getattr(enc, 'encoding', enc) or 'utf8', - 'backslashreplace') + 'replace') else: def str2u(s, enc=None): """Convert a native Python2 str to Unicode.""" return s.decode(getattr(enc, 'encoding', enc) or 'utf8', - 'backslashreplace') + 'replace') def str2b(s, enc=None): """Convert a native Python2 str to bytes. This is a NOP."""