[GRASS-dev] gis.m crashes on zoom to map existing in more than one mapset

Glynn Clements glynn at gclements.plus.com
Sat Jan 6 00:22:39 EST 2007


Daniel Calvelo wrote:

> > > The command used in mapcanvas.tcl is g.region -ugp rast=bugsites. This
> > > gives:
> > >
> > > GRASS 6.3.cvs (spearfish60):~ > g.region -ugp rast=bugsites
> > > WARNING: 'cell/bugsites' was found in more mapsets (also found in user1).
> >
> > This is a good example of why the solution to the recent
> > g.region/gis.m issues is to make gis.m handle warnings correctly
> > rather than trying to eliminate specific warnings.
> >
> > Even the simplest program can potentially result in warnings (or
> > similar diagnostics) being generated by libgis (or other libraries) in
> > some cases. And for third-party libraries (of which GDAL may use a
> > significant number), there is nothing which can be done about it.
> 
> Would having G_warning() output "#WARNING:" help? The initial '#'
> would be parseable as a comment, as it is in the shell. And alongside,
> eval of output in scripts wouldn't be affected. Of course, strict
> discipline of using G_* messages is compulsory.

Programs shouldn't attempt to parse stderr.

Merging stdout and stderr is purely a workaround for a Tcl misfeature
(treating anything written to stderr as an error). In the case where
you're actually parsing the output (rather than just dumping it to the
"gronsole" widget), it's the wrong workaround. In that case, stderr
should be redirected to a file or discarded (redirected to /dev/null
or NUL).

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




More information about the grass-dev mailing list