[GRASS-user] problem using grass.write_comman, db.execute

Glynn Clements glynn at gclements.plus.com
Fri Oct 2 22:43:57 EDT 2009


Nikos Alexandris wrote:

> I read the other day that Python3 will introduce some changes. At what
> extent will be os-geo stuff, and especially grass, affected? How should
> an average scripter behave? How to prepare scripts that are ready for
> changes?

The most fundamental change is that Python3's default string type is
Unicode; if you want byte strings, you have to specifically request
them (or in some cases, explicitly convert from Unicode, as is the
case with sys.argv and os.environ).

Needless to say, this doesn't interact well with Unix-style scripting,
where everything is byte strings. Expect to have to add a lot of
explict conversions between Unicode strings and byte strings.

OTOH, the change is sufficiently fundamental that you can expect the
2.x series to be maintained for the foreseeable future (even if Guido
abandons 2.x, someone else will maintain it).

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


More information about the grass-user mailing list