[cfe-dev] interesting ccc issue

Anders Carlsson andersca at mac.com
Wed Feb 6 08:21:49 PST 2008


6 feb 2008 kl. 08.11 skrev Sam Bishop:

> On Tue, February 5, 2008 5:20 pm, Anders Carlsson wrote:
>>  def run(args):
>> -    cmd = ' '.join(args)
>> +    cmd = ' '.join(args).replace("\"", "\\\"");
>>      print >> sys.stderr, cmd
>>      code = os.system(cmd)
>
> Double quotes, unfortunately, are just the tip of the iceberg.   
> Consider
> -DCMD_STRING='"echo $(ls)"' or -DNOP='do { } while (0)', for example.
>

Right.

> This is my fault.  When I proposed the subprocess.call() ->  
> os.system()
> conversion, I didn't consider the -D option and that its arguments  
> can be
> nearly anything.
>
> I think that we will be happiest long term if we go back to using the
> subprocess module and requiring a 2.4+ version of Python.  We'll  
> probably
> end up wanting other 2.4+ features anyway.
>

Given that Python 2.4 was released in late 2004, more than 3 years  
ago, I think it's safe to require 24..

> The attached patch reverts the subprocess.call() -> os.system()  
> conversion.
> A close review, of course, is welcome.  :)

Cool. I'll have a look and commit it.

Thanks!
Anders
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2415 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080206/a8c70f8f/attachment.bin>


More information about the cfe-dev mailing list