[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 02:47:34 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 hellik):

 Replying to [comment:5 pmav99]:
 > The traceback in the original post indicates that the problematic line
 is:
 > {{{
 >     if any(cmd.lower().endswith(ext.lower()) for ext in pathext):
 > }}}
 > which currently has been changed to (I guess with other changes, too):
 > {{{
 >     if any(cmd.lower().endswith(ext) for ext in pathext):
 > }}}
 > Could you please paste an updated traceback?

 looking into

 C:\OSGeo4W64\apps\grass\grass77\etc\python\grass\script\core.py

 {{{
         if any(cmd.lower().endswith(ext) for ext in pathext):
             files = [cmd]
         else:
             files = [cmd + ext for ext in pathext]
 }}}

 the question is why the traceback reports then:

 {{{
   File "C:\OSGEO4~1\apps\Python37\lib\shutil.py", line 1151, in which
     if any(cmd.lower().endswith(ext.lower()) for ext in pathext):
   File "C:\OSGEO4~1\apps\Python37\lib\shutil.py", line 1151, in <genexpr>
     if any(cmd.lower().endswith(ext.lower()) for ext in pathext):
 }}}

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



More information about the grass-dev mailing list