Index: docutils/test/test_functional.py =================================================================== --- docutils/test/test_functional.py (revision 7036) +++ docutils/test/test_functional.py (working copy) @@ -171,7 +171,10 @@ no_expected = self.no_expected_template % { 'exp': expected_path, 'out': params['destination_path']} self.assert_(os.access(expected_path, os.R_OK), no_expected) - f = open(expected_path, 'r') # ! 'rb' leads to errors with Python 3! + if sys.version_info < (3,0): + f = open(expected_path, 'r') + else: + f = open(expected_path, 'r', encoding='utf-8') # ! 'rb' leads to errors with Python 3! # Normalize line endings: expected = '\n'.join(f.read().splitlines()) f.close() Index: docutils/test/test_io.py =================================================================== --- docutils/test/test_io.py (revision 7036) +++ docutils/test/test_io.py (working copy) @@ -99,7 +99,7 @@ except UnicodeEncodeError: try: open(u'\xfc'.encode(sys.getfilesystemencoding(), 'replace')) - except IOError: + except IOError, e: uioe = e if locale: locale.setlocale(locale.LC_ALL, 'C') # reset