mirror of https://github.com/python/cpython
#7667: Fix doctest failures with non-ASCII paths.
This commit is contained in:
parent
798e54004f
commit
e1f4c92d23
|
@ -1328,7 +1328,8 @@ class DocTestRunner:
|
|||
m = self.__LINECACHE_FILENAME_RE.match(filename)
|
||||
if m and m.group('name') == self.test.name:
|
||||
example = self.test.examples[int(m.group('examplenum'))]
|
||||
return example.source.splitlines(True)
|
||||
source = example.source.encode('ascii', 'backslashreplace')
|
||||
return source.splitlines(True)
|
||||
else:
|
||||
return self.save_linecache_getlines(filename, module_globals)
|
||||
|
||||
|
|
Loading…
Reference in New Issue