Opened 8 years ago
Closed 6 years ago
#3171 closed defect (fixed)
Python script fails on windows if parameter contains non-latin letters
Reported by: | marisn | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.4.3 |
Component: | Python | Version: | svn-releasebranch72 |
Keywords: | Cc: | ||
CPU: | Unspecified | Platform: | MSWindows 8 |
Description
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
Change History (10)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
Replying to marisn:
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:
I believe that this a consequence of releasebranch_7_2 incorporating r65804 but not r68927. I suggest backporting the latter.
comment:5 by , 8 years ago
Milestone: | 7.2.1 → 7.2.2 |
---|
comment:9 by , 7 years ago
Milestone: | → 7.2.4 |
---|
comment:10 by , 6 years ago
Milestone: | 7.2.4 → 7.4.3 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
No answer, assuming that the issue was solved with the changes done.
Info on version although the code seems to be the same also in trunk.