[GRASS-dev] [GRASS GIS] #3723: winGRASS7.7.svn - python 3 issues

GRASS GIS trac at osgeo.org
Tue Jan 1 13:04:09 PST 2019


#3723: winGRASS7.7.svn - python 3 issues
------------------------------------+-------------------------
 Reporter:  hellik                  |      Owner:  grass-dev@…
     Type:  defect                  |     Status:  new
 Priority:  normal                  |  Milestone:
Component:  Python                  |    Version:  svn-trunk
 Keywords:  python3, py3, wingrass  |        CPU:  Unspecified
 Platform:  MSWindows               |
------------------------------------+-------------------------
 tested with a self compiled winGRASS7.7.svn with python 3

 {{{
 C:\>g.version -e -g
 version=7.7.svn
 date=2019
 revision=r73896M
 build_date=2019-01-01
 build_platform=x86_64-w64-mingw32
 build_off_t_size=8
 proj4=5.2.0
 gdal=2.4.0
 geos=3.7.0
 sqlite=3.26.0
 }}}

 {{{
 C:\>grass77svn --text
 Starting GRASS GIS...
 WARNING: Concurrent mapset locking is not supported on Windows
 Cleaning up temporary files...

           __________  ___   __________    _______________
          / ____/ __ \/   | / ___/ ___/   / ____/  _/ ___/
         / / __/ /_/ / /| | \__ \\_  \   / / __ / / \__ \
        / /_/ / _, _/ ___ |___/ /__/ /  / /_/ // / ___/ /
        \____/_/ |_/_/  |_/____/____/   \____/___//____/

 Welcome to GRASS GIS 7.7.svn (r73896M)
 GRASS GIS homepage:                      https://grass.osgeo.org
 This version running through:            Command Prompt
 (C:\WINDOWS\system32\cmd.exe)
 Help is available with the command:      g.manual -i
 See the licence terms with:              g.version -c
 See citation options with:               g.version -x
 Start the GUI with:                      g.gui wxpython
 When ready to quit enter:                exit

 Microsoft Windows [Version 10.0.17763.195]
 (c) 2018 Microsoft Corporation. Alle Rechte vorbehalten.

 C:\>python
 Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit
 (AMD64)] on win32
 Type "help", "copyright", "credits" or "license" for more information.
 >>> exit()
 }}}

 then g.gui wxpython errors in

 {{{
 C:\>g.gui wxpython
 Launching <wxpython> GUI in the background, please wait...
 Traceback (most recent call last):
   File
 "C:\OSGEO4~1\apps\grass\grass-7.7.svn\etc\python\grass\script\core.py",
 line 41, in <module>
     import __builtin__
 ModuleNotFoundError: No module named '__builtin__'

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "C:\OSGEO4~1\apps\grass\grass-7.7.svn/gui/wxpython/wxgui.py", line
 27, in <module>
     from core import globalvar
   File
 "C:\OSGEO4~1\apps\grass\grass-7.7.svn\gui\wxpython\core\globalvar.py",
 line 31, in <module>
     from core.debug import Debug
   File "C:\OSGEO4~1\apps\grass\grass-7.7.svn\gui\wxpython\core\debug.py",
 line 25, in <module>
     import grass.script as grass
   File
 "C:\OSGEO4~1\apps\grass\grass-7.7.svn\etc\python\grass\script\__init__.py",
 line 5, in <module>
     from .core   import *
   File
 "C:\OSGEO4~1\apps\grass\grass-7.7.svn\etc\python\grass\script\core.py",
 line 47, in <module>
     from os import environb as environ
 ImportError: cannot import name 'environb' from 'os'
 (C:\OSGEO4~1\apps\Python37\lib\os.py)
 }}}

 it seems that core.py hangs around

 {{{
 try:
     # python2
     import __builtin__
     from os import environ
     __builtin__.__dict__['_'] =
 __builtin__.__dict__['_'].__self__.ugettext
 except ImportError:
     # python3
     import builtins as __builtin__
     from os import environb as environ
     unicode = str
     __builtin__.__dict__['_'] = __builtin__.__dict__['_'].__self__.gettext
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/3723>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list