[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 07:33:59 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):
I am not sure I understand the last question. If you are asking why the
same line is being repeated, then, quoting from
[https://nedbatchelder.com/blog/201812/a_thing_i_learned_about_python_recursion.html
here]:
> In Python 3, all comprehensions (and in Python 2 all except list
comprehensions) are actually compiled as nested functions. Executing the
generator comprehension calls that hidden nested function, using up an
extra stack frame.
Generator functions are treated the same way. You can easily check this
like this:
{{{
$ python -c 'list(1 / i for i in (1, 2, 3, 0, 4, 5))'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "<string>", line 1, in <genexpr>
ZeroDivisionError: division by zero
}}}
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3837#comment:9>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list