[f2py] bug in f2pye/rules.py line 1231

sebastian.rooks at free.fr sebastian.rooks at free.fr
Tue Mar 29 15:45:33 EEST 2005


Dear Pearu,

I think there is a bug in the construction of the fortran 90 wrapper.
The bug is line 1231 of f2pye/rules.py (from CVS)

Original code (lines 1226 to 1237):

        lines = []
        for l in string.split(string.join(funcwrappers2,'\n\n')+'\n','\n'):
            if len(l)>=72 and l[0]==' ':
                lines.append(l[:72]+'&\n     &')
                l = l[72:]
                while len(l)>=66:
                    lines.append(l[:66]+'&\n     &')
                    l = l[66:]
                lines.append(l+'\n')
            else: lines.append(l+'\n')
        lines = string.join(lines,'').replace('\n     &\n','\n')
        f.write(lines)


Line 1231 should be
                while len(l)>66:

ie replace >= by > or when len(l)=66 a `&` will be added at the end of the line
whereas the `     &\n` added at the following line will be removed by the line
1236:
                                    .replace('\n     &\n','\n')

which ends up to a fortran compiler syntax error (with ifort).

Thank you very much for your great work with f2py and scipy.
Sincerly yours,

  Seb




More information about the f2py-users mailing list