[GRASS-dev] [GRASS GIS] #2326: Command functions in grass.script.core miss a correct error reporting
GRASS GIS
trac at osgeo.org
Thu Jun 26 14:44:52 PDT 2014
#2326: Command functions in grass.script.core miss a correct error reporting
--------------------------------+-------------------------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
Type: enhancement | Status: new
Priority: major | Milestone: 7.1.0
Component: Python | Version: svn-trunk
Keywords: script, exceptions | Platform: All
Cpu: Unspecified |
--------------------------------+-------------------------------------------
Comment(by wenzeslaus):
In r60993 I have added more parameters to `call_module()` function, so the
interface is more complicated but I expect (me) to use the defaults most
of the time and just add one or two parameters time to time. The other
functions (`run_`, `write_`, `read_`) are not so needed now, I may
consider removing them. Or at least reimplementing them using the general
`call_module()` function.
I hope that using
[https://docs.python.org/2/library/subprocess.html#subprocess.Popen.communicate
communicate()] will be safe most of the time. They say that ''The data
read is buffered in memory, so do not use this method if the data size is
large or unlimited.'' So, I should note this limitation in `call_module()`
too. Otherwise, they seem to believe that if you use `communicate()`, it
is safe (looking to the documentation and source code). What makes me not
sure are the things like
source:grass/trunk/gui/wxpython/core/gcmd.py?rev=60817#L553 and some
discussions on the internet.
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2326#comment:16>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list