[GRASS-dev] Add support for Python3

Pietro peter.zamb at gmail.com
Mon Aug 3 23:14:46 PDT 2015


Hi Glynn,

On Thu, Jul 30, 2015 at 4:34 PM, Glynn Clements wrote:
> 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.

ok, I try to avoid to use unicode in script with the following changes:

https://trac.osgeo.org/grass/changeset/65804

I've stopped to go on with the syncronization of my local changes and
trunk since I noticed that from the 27th of July the tests are not
running anymore:

http://fatra.cnr.ncsu.edu/grassgistests/summary_report/nc/index.html

I don't understand why, but I have the suspect that the recent changes
done in lib/init/grass.py and gunittest:

https://trac.osgeo.org/grass/changeset/65780
https://trac.osgeo.org/grass/changeset/65782

have broken something.

I will not go further on the development of python2/python3 until this
issue will be fix.

All the best.

Pietro


More information about the grass-dev mailing list