[GRASSGUI] Re: [grass-addons] r659 - trunk/grassaddons/gui/gui_modules

Glynn Clements glynn at gclements.plus.com
Wed May 16 13:11:09 EDT 2007


Michael Barton wrote:

> Are you thinking that we should change all calls to GRASS commands to use
> the new cmd module?

> > +        cmdString = "g.region -ugp region=%s" % wind

> > +        p = cmd.Command (cmdString)

This interface is broken, and needs to be replaced.

           self.module = subprocess.Popen(self.cmd, shell=True,
                                                    ^^^^^^^^^^

Wrong. Wrong. Wrong. Wrong. Wrong. Wrong. Wrong. Wrong. Wrong.

Just how clearly do I have to say this before it sinks in:

	DO NOT USE THE SHELL

Using the shell means problems with spaces, quotes and other shell
metacharacters. There is no reason to use it. So don't.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-gui mailing list