diff options
Diffstat (limited to 'git/compat.py')
-rw-r--r-- | git/compat.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/git/compat.py b/git/compat.py index 146bfd4b..1630fcd5 100644 --- a/git/compat.py +++ b/git/compat.py @@ -56,7 +56,9 @@ def safe_decode(s): return s elif isinstance(s, six.binary_type): if PRE_PY27: - return s.decode(defenc) # we're screwed + # Python 2.6 does not support the `errors` argument, so we cannot + # control the replacement of unsafe chars in it. + return s.decode(defenc) else: return s.decode(defenc, errors='replace') raise TypeError('Expected bytes or text, but got %r' % (s,)) |