[Numpy-svn] r8711 - trunk/numpy/distutils/fcompiler
numpy-svn at scipy.org
numpy-svn at scipy.org
Sat Sep 11 17:34:37 EDT 2010
Author: ptvirtan
Date: 2010-09-11 16:34:37 -0500 (Sat, 11 Sep 2010)
New Revision: 8711
Modified:
trunk/numpy/distutils/fcompiler/__init__.py
Log:
BUG: distutils: make is_free_format et al. not choke on non-ascii Fortran files
Modified: trunk/numpy/distutils/fcompiler/__init__.py
===================================================================
--- trunk/numpy/distutils/fcompiler/__init__.py 2010-09-11 18:13:17 UTC (rev 8710)
+++ trunk/numpy/distutils/fcompiler/__init__.py 2010-09-11 21:34:37 UTC (rev 8711)
@@ -25,6 +25,8 @@
except NameError:
from sets import Set as set
+from numpy.compat import open_latin1
+
from distutils.sysconfig import get_config_var, get_python_lib
from distutils.fancy_getopt import FancyGetopt
from distutils.errors import DistutilsModuleError, \
@@ -911,7 +913,7 @@
# f90 allows both fixed and free format, assuming fixed unless
# signs of free format are detected.
result = 0
- f = open(file,'r')
+ f = open_latin1(file,'r')
line = f.readline()
n = 10000 # the number of non-comment lines to scan for hints
if _has_f_header(line):
@@ -931,7 +933,7 @@
return result
def has_f90_header(src):
- f = open(src,'r')
+ f = open_latin1(src,'r')
line = f.readline()
f.close()
return _has_f90_header(line) or _has_fix_header(line)
@@ -944,7 +946,7 @@
Return a dictionary {<fcompiler type>:<f77 flags>}.
"""
flags = {}
- f = open(src,'r')
+ f = open_latin1(src,'r')
i = 0
for line in f.readlines():
i += 1
More information about the Numpy-svn
mailing list