From 850c569fbca5e2d3352aecb2dced060ab3f5162a Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 21 Aug 2009 10:20:11 +0200 Subject: [PATCH] make sure we do not break encoded scripts when extracting expected error messages in runtests.py --- runtests.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/runtests.py b/runtests.py index a6f68856..2ffbb465 100644 --- a/runtests.py +++ b/runtests.py @@ -1,6 +1,12 @@ #!/usr/bin/python -import os, sys, re, shutil, unittest, doctest +import os +import sys +import re +import codecs +import shutil +import unittest +import doctest WITH_CYTHON = True @@ -237,9 +243,10 @@ class CythonCompileTestCase(unittest.TestCase): def split_source_and_output(self, directory, module, workdir): source_file = os.path.join(directory, module) + '.pyx' - source_and_output = open( - self.find_module_source_file(source_file), 'rU') - out = open(os.path.join(workdir, module + '.pyx'), 'w') + source_and_output = codecs.open( + self.find_module_source_file(source_file), 'rU', 'ISO-8859-1') + out = codecs.open(os.path.join(workdir, module + '.pyx'), + 'w', 'ISO-8859-1') for line in source_and_output: last_line = line if line.startswith("_ERRORS"): -- 2.26.2