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.
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.
The attached patch reverts the subprocess.call() -> os.system() conversion.
A close review, of course, is welcome. :)
Sincerely,
Sam Bishop
ccc-use-subprocess-module.patch
Description: Binary data
_______________________________________________ cfe-dev mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
