[GRASS-dev] python script utils encoding/decoding overriding unicode with python-future

Moritz Lennert mlennert at club.worldonline.be
Fri Aug 25 08:39:16 PDT 2017


On 25/08/17 17:32, Pietro wrote:
> On Fri, Aug 25, 2017 at 5:14 PM, Moritz Lennert
> <mlennert at club.worldonline.be> wrote:
>> On 25/08/17 17:06, Pietro wrote:
>>>
>>> Unfortunately builtins is used also in other files, and I’m afraid
>>> that I should also fix these:
> 
> Actually most of them are working properly, I was thinking that the
> module builtins was present in both python2 and python3 and only
> contains different functions.
> 
> Instead builtins exists only in python3, so most of them works because
> in python2 try to import some function from builtins and it raise an
> exception not because the function does not exists but because the
> module does not exists!

Yes, but the exception then acts as if it is in Python 3, so this might 
cause problems (just as we saw for utils.py).


> Do you think that should we fix them in any case?

In light of the above, yes.


> 
>> Is this in grass72 as well, or only trunk ?
> 
> Changes in scripts.utils is only in trunk:
> 
> https://trac.osgeo.org/grass/browser/grass/tags/release_20170810_grass_7_2_2RC1/lib/python/script/utils.py
> 
>   the other are already in the code.
> 
> https://trac.osgeo.org/grass/browser/grass/tags/release_20170810_grass_7_2_2RC1/lib/python/temporal/core.py#L38

So this probably needs to be taken care of before the imminent release.

Moritz


More information about the grass-dev mailing list