#7667: Fix doctest failures with non-ASCII paths.

This commit is contained in:
Florent Xicluna 2010-03-22 22:45:50 +00:00
parent 798e54004f
commit e1f4c92d23
2 changed files with 4 additions and 1 deletions

View file

@ -1328,7 +1328,8 @@ class DocTestRunner:
m = self.__LINECACHE_FILENAME_RE.match(filename) m = self.__LINECACHE_FILENAME_RE.match(filename)
if m and m.group('name') == self.test.name: if m and m.group('name') == self.test.name:
example = self.test.examples[int(m.group('examplenum'))] example = self.test.examples[int(m.group('examplenum'))]
return example.source.splitlines(True) source = example.source.encode('ascii', 'backslashreplace')
return source.splitlines(True)
else: else:
return self.save_linecache_getlines(filename, module_globals) return self.save_linecache_getlines(filename, module_globals)

View file

@ -29,6 +29,8 @@ Core and Builtins
Library Library
------- -------
- Issue #7667: Fix doctest failures with non-ASCII paths.
- Issue #7512: shutil.copystat() could raise an OSError when the filesystem - Issue #7512: shutil.copystat() could raise an OSError when the filesystem
didn't support chflags() (for example ZFS under FreeBSD). The error is didn't support chflags() (for example ZFS under FreeBSD). The error is
now silenced. now silenced.