[GRASS-dev] [GRASS GIS] #3446: GRASS python library is not working with python 3

GRASS GIS trac at osgeo.org
Mon Dec 10 22:09:02 PST 2018


#3446: GRASS python library is not working with python 3
---------------------+-----------------------------------------------
  Reporter:  lrntct  |      Owner:  grass-dev@…
      Type:  defect  |     Status:  new
  Priority:  major   |  Milestone:  7.8.0
 Component:  Python  |    Version:  7.2.1
Resolution:          |   Keywords:  python python3 ctypes, python 3.7
       CPU:  x86-64  |   Platform:  Linux
---------------------+-----------------------------------------------

Comment (by neteler):

 Replying to [comment:20 lucadelu]:
 > Replying to [comment:19 neteler]:
 > > Now I have an issue with g.extension:
 > >
 > > {{{
 > > GRASS 7.7.svn (utm32N):~ > python --version
 > > Python 3.7.1
 > >
 > > GRASS 7.7.svn (utm32N):~ > g.extension i.fusion.hpf
 > > ...
 > >   File "/home/mneteler/software/grass77/dist.x86_64-pc-linux-
 gnu/scripts/g.extension", line 1043, in fix_newlines
 > >     if '\0' in data:
 > > TypeError: a bytes-like object is required, not 'str'
 > > }}}
 > >
 > > Likewise with other addon modules to be installed...
 >
 > I think most of the addons since they are mostly written for Python >=
 2.6
 > We need to port the addons to python3

 I had updated some and it also fails with those.

 To me it looks like a bug in g.extension itself:

 https://trac.osgeo.org/grass/browser/grass/trunk/scripts/g.extension/g.extension.py#L1042

 When I delete these lines
 {{{
             #if '\0' in data:
             #    continue  # ignore binary files
 }}}

 then g.extension works fine.

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/3446#comment:21>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list