[Distutils] Possible Distutils shell processing bug

Brian Quinlan brian@sweetapp.com
Fri Jan 4 19:30:02 2002


Hi,

Is it intended that users must escape their own strings, which are
passed to the shell? As an example, if I wanted to define a string for
the preprocessor, I would have to do something like this:

defines = [('VERSION',r'\"1.2.3\"')]

If I hadn't escaped the double quotes then the shell would have removed
them*. 

It took me a good five minutes to figure out this problem and I'm sure
that others have hit this gotcha.

Cheers,
Brian

*
python -c "import sys; print `sys.argv`" test
['-c', 'test']

python -c "import sys; print `sys.argv`" "test"
['-c', 'test']

python -c "import sys; print `sys.argv`" ""test""
['-c', 'test']