On 7/20/07, Guido van Rossum <[EMAIL PROTECTED]> wrote:
This seems to have fixed doctest for OSX, but not for my Ubuntu
system. I wonder if there's an issue with a different default
filesystem encoding? On OSX it's 'utf-8', but on my ubuntu box it says
'ISO-8859-1'.
The attached patch makes test_doctest pass for me on Ubuntu; could you
try it on OS X?
Collin
Index: Lib/doctest.py
===================================================================
--- Lib/doctest.py (revision 56470)
+++ Lib/doctest.py (working copy)
@@ -95,7 +95,7 @@
import __future__
-import sys, traceback, inspect, linecache, os, re
+import sys, traceback, inspect, linecache, os, re, io
import unittest, difflib, pdb, tempfile
import warnings
from StringIO import StringIO
@@ -210,7 +210,7 @@
if hasattr(package, '__loader__'):
if hasattr(package.__loader__, 'get_data'):
return package.__loader__.get_data(filename), filename
- return open(filename).read(), filename
+ return io.open(filename, encoding="utf-8").read(), filename
def _indent(s, indent=4):
"""
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins