[GRASS-dev] Add support for Python3

Glynn Clements glynn at gclements.plus.com
Thu Jul 30 07:34:27 PDT 2015


Pietro wrote:

> ok, I've now synchronized my local changes in script/core to trunk:

In parser() in lib/python/script/core.py:

    s = p.communicate()[0].decode()

the .decode() shouldn't be there; the output should be kept as bytes. 
This may require changing _parse_opts().

Likewise for parse_key_val() in utils.py.

More generally, nothing in grass.script should be using unicode
values. Arguments which happen to be unicode values can be encode()d
to bytes, but arguments which are bytes must be used as-is (no
bytes-unicode-bytes round trips) and data obtained from files, pipes,
environment variables, OS functions, etc should be returned as bytes.

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


More information about the grass-dev mailing list