diff options
author | Pauli Virtanen <pav@iki.fi> | 2010-09-11 21:34:37 +0000 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2010-09-11 21:34:37 +0000 |
commit | a70f5718a6199919e5bddf4a7daa032ae80c6779 (patch) | |
tree | e5bbcae327cb687ed76d1174e65e96d781a6d185 /numpy | |
parent | 36bb1c9eff58e80fe4309837c9b8eb0bb3f40b82 (diff) | |
download | numpy-a70f5718a6199919e5bddf4a7daa032ae80c6779.tar.gz |
BUG: distutils: make is_free_format et al. not choke on non-ascii Fortran files
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/distutils/fcompiler/__init__.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/numpy/distutils/fcompiler/__init__.py b/numpy/distutils/fcompiler/__init__.py index 26ea73895..3fd3f22dc 100644 --- a/numpy/distutils/fcompiler/__init__.py +++ b/numpy/distutils/fcompiler/__init__.py @@ -25,6 +25,8 @@ try: 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 @@ def is_free_format(file): # 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 @@ def is_free_format(file): 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 @@ def get_f77flags(src): 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 |