[GRASS-dev] [GRASS GIS] #3171: Python script fails on windows if parameter contains non-latin letters

GRASS GIS trac at osgeo.org
Fri Sep 30 05:15:19 PDT 2016


#3171: Python script fails on windows if parameter contains non-latin letters
-------------------------+---------------------------------
 Reporter:  marisn       |      Owner:  grass-dev@…
     Type:  defect       |     Status:  new
 Priority:  normal       |  Milestone:  7.2.1
Component:  Python       |    Version:  svn-releasebranch72
 Keywords:               |        CPU:  Unspecified
 Platform:  MSWindows 8  |
-------------------------+---------------------------------
 I have written a python GRASS module that accepts string as an option
 (passed via parser). It runs just fine on Linux, but on Windows 10 it is
 causing failure:
 {{{
 gol name=ģļāžšķūņā ŗūķeļi steps=1000 density=0.25
 Traceback (most recent call last):
   File ".\gol.py", line 233, in <module>
     options, flags = grass.parser()
   File "C:\OSGeo4W\apps\grass\grass-7.1.svn\etc\python\grass
 \script\core.py", line 719, in parser
     cmdline += [b'"' + encode(arg) + b'"' for arg in
 sys.argv[1:]]
   File "C:\OSGeo4W\apps\grass\grass-7.1.svn\etc\python\grass
 \script\utils.py", line 174, in encode
     return string.encode(enc)
   File "C:\OSGeo4W\apps\Python27\lib\encodings\cp1257.py",
 line 12, in encode
     return
 codecs.charmap_encode(input,errors,encoding_table)
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xec in
 position 5: ordinal not in range(128)
 }}}

 The error seems to originate from the same place as for #2886

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



More information about the grass-dev mailing list