[GRASS-dev] GRASS 7 scripts overhaul

Glynn Clements glynn at gclements.plus.com
Tue Sep 13 06:16:00 EDT 2011


Michael Barton wrote:

> > line 267, in main
> >    x, y = xy.split('\t')
> > ValueError: need more than 1 value to unpack
> 
> I don't know this script, but this error means that the string xy
> has more than 2 items that are separated by a tab (or by a space in
> the earlier post).

Wrong. In that case, the error would be "too many values to unpack".

In this case, the error is that there are too few values: splitting
the string results in a single value (i.e. there are *zero* tabs),
when two values are expected.

I can't actually reproduce this error.

The problems which I had with cs2cs were related to the case where the
-E flag was used (when copy_input is True). In that situation, cs2cs
copies some prefix of the input to the beginning of the output,
complete with whatever whitespace it contained, and also copied some
portion of the input to the end of the output, again with whitespace
intact.

This means that the two fields we're actually interested in are
bracketed by arbitrary text containing (apparently) arbitrary
whitespace, which makes identifying those fields impossible.

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


More information about the grass-dev mailing list