[GRASS-dev] [GRASS-SVN] r63227 - in grass/trunk/scripts: d.correlate d.out.file d.rast.leg d.redraw d.shadedmap d.to.rast d.vect.thematic d.what.rast d.what.vect

Glynn Clements glynn at gclements.plus.com
Wed Dec 3 09:54:06 PST 2014


Vaclav Petras wrote:

> > > The issue is this:
> > >
> > > GRASS 7.1.svn (nc_spm_08_grass7):~ > g.region rast=lsat7_2002_30
> > > GRASS 7.1.svn (nc_spm_08_grass7):~ > d.correlate
> > map=lsat7_2002_30,lsat7_2002_40
> > > ERROR: No graphics device selected. Use d.mon to select graphics device.
> > > Traceback (most recent call last):
> > > ...
> > > grass.exceptions.CalledModuleError: Module run None ['d.text',
> > > 'color=black', 'line=1', 'stdin=CORRELATION', 'size=4'] ended with
> > > error
> > > Process ended with non-zero return code 1. See errors in the (error)
> > output.
> >
> > I can't reproduce the problem. And I'm not even sure how d.text can
> > exit with a non-zero return code without printing any error message.
> 
> 
> I can reproduce it. Are you sure you don't have MONITOR or
> GRASS_RENDER_IMMEDIATE (or any other if it matters) set? I start GRASS
> session (without any special shell environment) and I get it.
> 
> The error is the beginning, r.text is printed first (that's ERROR:... I
> think), then the error from the main process is printed (Traceback....).

Er, right; I got confused by the fact that the script changes used
exactly the same error message as d.text (which is a leftover from
6.x).

The issue has been fixed in r63361. The issue was first introduced in
r46984 and incorrectly "fixed" in r46999.

In GRASS 7, it isn't (or shouldn't have been) necessary to set
GRASS_RENDER_IMMEDIATE. This variable only exists to choose a driver
other than the default (cairo if supported, otherwise PNG).

> I think the solution is try-except or calling the function(s) with with
> secret `errors` parameter set to 'exit'.

No. There's no point in catching exceptions if you aren't going to
handle them. If we want to avoid the tracebacks, we should find a
solution which works globally, not require each and every script to
manually handle exceptions from each and every called module.

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


More information about the grass-dev mailing list