diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-22 22:45:50 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-22 22:45:50 (GMT) |
commit | e1f4c92d23d9fb71bbaf76be12e80757c7d43e6a (patch) | |
tree | 5bbdc9451ce0c0b093f675fc7b4315436126a04b /Lib | |
parent | 798e54004f47b8173ef70e6df0132bedceb13311 (diff) | |
download | cpython-e1f4c92d23d9fb71bbaf76be12e80757c7d43e6a.zip cpython-e1f4c92d23d9fb71bbaf76be12e80757c7d43e6a.tar.gz cpython-e1f4c92d23d9fb71bbaf76be12e80757c7d43e6a.tar.bz2 |
#7667: Fix doctest failures with non-ASCII paths.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/doctest.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py index 726517e..a9357b5 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -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) |