File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 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):
2727 return None
2828
2929 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'\\ ' ))
3134
3235 if has_ab_prefix :
3336 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):
158158 self .assertEqual (res [5 ].b_path , u'path/with\n newline' )
159159 self .assertEqual (res [6 ].b_path , u'path/with spaces' )
160160 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/¯\ \ _(ツ)_|¯' )
162162
163163 # The "Moves"
164164 # 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