This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author christopher.hogan
Recipients christopher.hogan, eric.araujo, mgiuca, r.david.murray, tarek
Date 2015-08-18.18:42:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1439923326.72.0.590937229773.issue8987@psf.upfronthosting.co.za>
In-reply-to
Content
At Intel, we've run into problems with external modules giving paths to _nt_quote_args that contain trailing backslashes, which escapes the final quote and breaks the command.  This fix takes care of special characters, trailing backslashes, and embedded quotes as in Matt's example.  I've also added unit tests for these cases, as well as a high level test that builds an extension and defines some macros that contain quotes and special characters. 

setup.py - Includes a library directory with a trailing backslash. I compiled a simple library, test_module.lib, and put it in that directory to test the linking.  This fails without my fix.  The macro definitions also fail without this fix.

testmodule.c - A simple C extension.  It just makes sure everything worked and returns the string "Success!"

As for current workarounds in setup scripts, I know numpy uses their own distutils.  They wrote a quote_args() function that they use instead of _nt_quote_args(). It checks for spaces, but only if the argument isn't already quoted.  It doesn't account for other special characters or trailing backslashes.
History
Date User Action Args
2015-08-18 18:42:06christopher.hogansetrecipients: + christopher.hogan, tarek, eric.araujo, mgiuca, r.david.murray
2015-08-18 18:42:06christopher.hogansetmessageid: <1439923326.72.0.590937229773.issue8987@psf.upfronthosting.co.za>
2015-08-18 18:42:06christopher.hoganlinkissue8987 messages
2015-08-18 18:42:06christopher.hogancreate