[GRASS-dev] mkhtml fails on Windows with UnicodeDecodeError

Martin Landa landa.martin at gmail.com
Wed Aug 24 01:24:40 PDT 2022


Dear all,

út 23. 8. 2022 v 18:49 odesílatel Martin Landa <landa.martin at gmail.com>
napsal:

> python3 /usr/src/grass78/dist.x86_64-w64-mingw32/tools/mkhtml.py v.random
> > /usr/src/grass78/dist.x86_64-w64-mingw32/docs/html/v.random.html
>
> Traceback (most recent call last):
>   File "C:\msys64\usr\src\grass78\dist.x86_64-w64-mingw32\tools\mkhtml.py", line 648, in <module>
>     git_commit = get_last_git_commit(
>   File "C:\msys64\usr\src\grass78\dist.x86_64-w64-mingw32\tools\mkhtml.py", line 235, in get_last_git_commit
>     stdout = decode(stdout)
>   File "C:\msys64\usr\src\grass78\dist.x86_64-w64-mingw32\tools\mkhtml.py", line 111, in decode
>     return bytes_.decode(enc)
>   File "C:\\OSGeo4W\\apps\\Python39\lib\encodings\cp1250.py", line 15, in decode
>     return codecs.charmap_decode(input,errors,decoding_table)
> UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 58: character maps to <undefined
>
> the question is also why we are using default OS encoding to decode HTML
pages [1]. Couldn't we simply use UTF-8 regardless of OS system locale?

Martin

[1]
https://github.com/OSGeo/grass/blob/releasebranch_7_8/tools/mkhtml.py#L93

-- 
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20220824/db5ba68f/attachment.htm>


More information about the grass-dev mailing list