[SciPy-dev] Log problem in exec_command.py
Pearu Peterson
pearu at scipy.org
Fri Mar 26 11:19:34 EST 2004
On Fri, 26 Mar 2004, [ISO-8859-15] Berthold Höllmann wrote:
> Hello,
>
> In an attempt to debug my Solaris compile problem I added
>
> from scipy_distutils.log import set_verbosity
> set_verbosity(2)
>
> to my setup.py file. Now I get
>
> ...
> File "/usr/local/gltools/python/Python-2.2.1/sol2/lib/python2.2/site-packages/scipy_distutils/exec_command.py", line 186, in exec_command
> ','.join(['%s=%r'%kv for kv in env.items()])))
> File "<string>", line 23, in debug
> File "<string>", line 16, in _log
> TypeError: not enough arguments for format string
>
> The problem is one of the arguments to the sun FORTRAN compiler. log gets
>
> exec_command(['f90', '-f77', '-ftrap=%none', '-xcode=pic32', '-c', 'lib/engforcegen/engforcelib.f', '-o', 'build.Engmodel/temp.solaris-2.8-sun4u-2.2/lib/engforcegen/engforcelib.o'],)
>
> The problem seems to be in the '-ftrap=%none'. log() does string
> replacement. My solution is to change lines 186/7 to
>
> log.debug(('exec_command(%r,%s)' % (command,\
> ','.join(['%s=%r'%kv for kv in env.items()]))).replace("%", "%%"))
>
> and lines 386/7 to
>
> log.debug(('Running %s(%s,%r,%r,os.environ)' \
> % (spawn_command.__name__,os.P_WAIT,argv[0],argv)).replace("%", "%%"))
Thanks, I have applied a patch to log.py that fixes this bug.
Pearu
More information about the SciPy-Dev
mailing list