[Python-checkins] r79307 - in python/trunk: Lib/doctest.py Misc/NEWS

florent.xicluna python-checkins at python.org
Mon Mar 22 23:45:50 CET 2010


Author: florent.xicluna
Date: Mon Mar 22 23:45:50 2010
New Revision: 79307

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


Modified:
   python/trunk/Lib/doctest.py
   python/trunk/Misc/NEWS

Modified: python/trunk/Lib/doctest.py
==============================================================================
--- python/trunk/Lib/doctest.py	(original)
+++ python/trunk/Lib/doctest.py	Mon Mar 22 23:45:50 2010
@@ -1328,7 +1328,8 @@
         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)
 

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Mon Mar 22 23:45:50 2010
@@ -29,6 +29,8 @@
 Library
 -------
 
+- Issue #7667: Fix doctest failures with non-ASCII paths.
+
 - Issue #7512: shutil.copystat() could raise an OSError when the filesystem
   didn't support chflags() (for example ZFS under FreeBSD).  The error is
   now silenced.


More information about the Python-checkins mailing list