[GRASS-dev] [GRASS GIS] #3837: OSGeo4W winGRASS77svn - startup error: TypeError: endswith first arg must be bytes or a tuple of bytes, not str
GRASS GIS
trac at osgeo.org
Sat May 11 08:52:17 PDT 2019
#3837: OSGeo4W winGRASS77svn - startup error: TypeError: endswith first arg must
be bytes or a tuple of bytes, not str
--------------------------+------------------------------------
Reporter: hellik | Owner: grass-dev@…
Type: defect | Status: new
Priority: blocker | Milestone: 7.8.0
Component: Python | Version: svn-trunk
Resolution: | Keywords: python3, py3, wingrass
CPU: Unspecified | Platform: MSWindows
--------------------------+------------------------------------
Comment (by pmav99):
OK, I see what is going on now.
You are using Python 3.7. As a a result the {{{shutil_which}}} name is
[https://github.com/GRASS-GIS/grass-
ci/blob/a26ceefdc4e14edc0529b90c4d92c0122b6a4d0e/lib/python/script/core.py#L230-L231
an alias] to [https://docs.python.org/3/library/shutil.html#shutil.which
shutil.which] function
[https://github.com/python/cpython/blob/79efbb719383386051c72f2ee932eeca8e033e6b/Lib/shutil.py#L1293
defined] in the standard library.
On Python 2 though, shutil_which is the function [https://github.com
/GRASS-GIS/grass-
ci/blob/a26ceefdc4e14edc0529b90c4d92c0122b6a4d0e/lib/python/script/core.py#L160
defined] in {{{scripts/core.py}}}.
This is why there is this difference. The function in scripts.core is
never executed in Python 3.
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3837#comment:12>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list