#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: | Keywords: ------------------------+--------------------------- With the old OSGeo4W repository EXE installer (QGIS 3.18.1):
{{{ import sys bool(sys.flags.utf8_mode) True import locale locale.getpreferredencoding(False) 'UTF-8' }}} while with the new OSGeo4W repository MSI installer (QGIS 3.18.1): {{{ import sys bool(sys.flags.utf8_mode) False import locale locale.getpreferredencoding(False) 'cp1252' }}} With the new MSI installer, this leads to issues with the Python console script editor if the script contains non cp1252 encoded characters, while there is no issue with the old EXE installer, as reported on GitHub issue tracker https://github.com/qgis/QGIS/issues/43834 **How to Reproduce** Enter {{{ print('áéŐŰÍ') }}} in the Python script editor window and run the script. The script will execute without issue using QGIS from the old repository EXE installer, while it will generate the following error using QGIS from the new repository MSI installer: {{{ Traceback (most recent call last): File "F:\QGIS\SOURCE~1\qgis\apps\Python39\lib\code.py", line 90, in runcode exec(code, self.locals) File "<input>", line 1, in <module> File "F:\QGIS\SOURCE~1\qgis\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> OSGeo4W <http://trac.osgeo.org/osgeo4w> OSGeo4W is the Windows installer and package environment for the OSGeo stack.
_______________________________________________ osgeo4w-dev mailing list osgeo4w-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/osgeo4w-dev