File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,10 @@ def decode_path(path, has_ab_prefix=True):
27
27
return None
28
28
29
29
if path .startswith (b'"' ) and path .endswith (b'"' ):
30
- path = path [1 :- 1 ].decode ('string_escape' )
30
+ path = (path [1 :- 1 ].replace (b'\\ n' , b'\n ' )
31
+ .replace (b'\\ t' , b'\t ' )
32
+ .replace (b'\\ "' , b'"' )
33
+ .replace (b'\\ \\ ' , b'\\ ' ))
31
34
32
35
if has_ab_prefix :
33
36
assert path .startswith (b'a/' ) or path .startswith (b'b/' )
Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ def test_diff_unsafe_paths(self):
158
158
self .assertEqual (res [5 ].b_path , u'path/with\n newline' )
159
159
self .assertEqual (res [6 ].b_path , u'path/with spaces' )
160
160
self .assertEqual (res [7 ].b_path , u'path/with-question-mark?' )
161
- self .assertEqual (res [8 ].b_path , ur 'path/¯\_(ツ)_|¯' )
161
+ self .assertEqual (res [8 ].b_path , u 'path/¯\ \ _(ツ)_|¯' )
162
162
163
163
# The "Moves"
164
164
# NOTE: The path prefixes a/ and b/ here are legit! We're actually
You can’t perform that action at this time.
0 commit comments