Mailing List Archive

[issue4672] Distutils SWIG support blocks use of SWIG -outdir option
William Fulton <wsf@fultondesigns.co.uk> added the comment:

This error can be replicated on the command line with suitable quoting
of the -outdir option:
swig -c++ "-outdir ."

You need to pass the options correctly by separating them out, so use:

swig_opts=['-c++', '-I@HEPMCINCPATH@', '-outdir', '.']

I suggest distutils is fixed to show the quotes it is effectively adding
when displaying the command, so for the example Andy gave it should display:

swigging ./hepmc.i to ./hepmc_wrap.cpp
swig -python -c++ -I/home/andy/heplocal/include "-outdir ." -o
./hepmc_wrap.cpp ./hepmc.i

The quotes would need adding for display when a user has a space in any
of the options passed to SWIG (including the include_dirs etc).

----------
nosy: +postofficered

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue4672>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue4672] Distutils SWIG support blocks use of SWIG -outdir option [ In reply to ]
Tarek Ziadé <ziade.tarek@gmail.com> added the comment:

Good suggestion, I'll add the quotes in the spawn call

Which does a simple log.info(string.join(cmd, ' ')) at the moment

----------
assignee: -> tarek
nosy: +tarek
versions: +Python 2.6, Python 2.7, Python 3.0, Python 3.1 -Python 2.5

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue4672>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue4672] Distutils SWIG support blocks use of SWIG -outdir option [ In reply to ]
Andy Buckley <andy@insectnation.org> added the comment:

Dumb question, but why is distutils wrapping the command args in quotes
anyway? I'm not even sure why lists are being used (rather than a
string) for the options, except that lists are a bit more "Pythony" and
can be used to semantically divide the options from each other. If you
end up having to use separate list elements for the option flag and the
value it takes, doesn't that indicate that the list isn't being used
properly?

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue4672>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com