[Qgis-developer] R scripts for raster layers in External Apps of the Sextante Toolbox plugin
Etienne Tourigny
etourigny.dev at gmail.com
Mon Aug 27 07:33:57 PDT 2012
On Mon, Aug 27, 2012 at 11:12 AM, Barry Rowlingson
<b.rowlingson at lancaster.ac.uk> wrote:
> On Mon, Aug 27, 2012 at 1:22 PM, Werner Macho <werner.macho at gmail.com> wrote:
>> On Mon, Aug 27, 2012 at 1:37 PM, Agustin Lobo <alobolistas at gmail.com> wrote:
>>> Hi!
>>>
>>> I've tried the R script in scripts/Raster histogram
>>> and do not get any plot, just get what can be seen here
>>> (after trying multiple alternatives):
>>> http://dl.dropbox.com/u/3180464/RSextante.jpeg
>
> I think the subprocess.Popen call in RUtils is at fault. The
> "command" is a list, but I think shell=True causes it to be sent to
> the shell as a command line. If you concatenate (join) the command
> list with spaces into a single string, this works:
>
You are right, because shell=True is used when command is a string,
not an array.
Plus it's deemed a security hazard:
Warning Invoking the system shell with shell=True can be a security
hazard if combined with untrusted input. See the warning under
Frequently Used Arguments for details.
> proc = subprocess.Popen(" ".join(command), shell=True,
> stdout=subprocess.PIPE,
> stdin=subprocess.PIPE,stderr=subprocess.STDOUT,
> universal_newlines=True)
>
>
> line 62 of RUtils.py in the sextante plugin.
>
> Barry
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
More information about the Qgis-developer
mailing list