[osgeo4w-dev] [osgeo4w] #682: MSI and EXE installers: different Python locale settings leads to issues with the Python console script editor

OSGeo4W trac_osgeo4w at osgeo.org
Tue Jun 22 12:13:52 PDT 2021


#682: MSI and EXE installers: different Python locale settings leads to issues
with the Python console script editor
------------------------+----------------------------
Reporter:  andreaerdna  |       Owner:  osgeo4w-dev@…
    Type:  defect       |      Status:  new
Priority:  major        |   Component:  Package
 Version:               |  Resolution:
Keywords:               |
------------------------+----------------------------

Comment (by nicogodet):

 I add `set PYTHONUTF8=1`, re-run `qgis.bat --postinstall` but nope.

 I need to run `qgis.bat` instead of `qgis-bin.exe` to have PYTHONUTF8 in
 os.environ

 {{{
 >>> os.environ["PYTHONUTF8"]
 '1'
 }}}

 {{{
 >>> exec(open('C:/Users/Nicolas Godet/Desktop/Sans titre
 1.py'.encode('utf-8')).read())
 Traceback (most recent call last):
   File "C:\OSGeo4W\apps\Python39\lib\code.py", line 90, in runcode
     exec(code, self.locals)
   File "<input>", line 1, in <module>
   File "C:\OSGeo4W\apps\Python39\lib\encodings\cp1252.py", line 23, in
 decode
     return codecs.charmap_decode(input,self.errors,decoding_table)[0]
 UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 12:
 character maps to <undefined>
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/osgeo4w/ticket/682#comment:4>
OSGeo4W <http://trac.osgeo.org/osgeo4w>
OSGeo4W is the Windows installer and package environment for the OSGeo stack.


More information about the osgeo4w-dev mailing list