summaryrefslogtreecommitdiff
path: root/git/diff.py
diff options
context:
space:
mode:
authorVincent Driessen <me@nvie.com>2016-04-20 00:07:22 +0200
committerVincent Driessen <me@nvie.com>2016-04-20 00:12:55 +0200
commit19099f9ce7e8d6cb1f5cafae318859be8c082ca2 (patch)
tree29e5a3d429b5e1ce54f2feadfe342bb4030b960d /git/diff.py
parent7fbc182e6d4636f67f44e5893dee3dcedfa90e04 (diff)
downloadgitpython-19099f9ce7e8d6cb1f5cafae318859be8c082ca2.tar.gz
Python 3 compat fixes
Specifically "string_escape" does not exist as an encoding anymore.
Diffstat (limited to 'git/diff.py')
-rw-r--r--git/diff.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/git/diff.py b/git/diff.py
index a7e7411d..76426940 100644
--- a/git/diff.py
+++ b/git/diff.py
@@ -27,7 +27,10 @@ def decode_path(path, has_ab_prefix=True):
return None
if path.startswith(b'"') and path.endswith(b'"'):
- path = path[1:-1].decode('string_escape')
+ path = (path[1:-1].replace(b'\\n', b'\n')
+ .replace(b'\\t', b'\t')
+ .replace(b'\\"', b'"')
+ .replace(b'\\\\', b'\\'))
if has_ab_prefix:
assert path.startswith(b'a/') or path.startswith(b'b/')