From lauri.kajan at gmail.com Thu Jun 3 06:45:55 2021 From: lauri.kajan at gmail.com (Lauri Kajan) Date: Thu, 3 Jun 2021 16:45:55 +0300 Subject: [osgeo4w-dev] Osgeo4w NG, DLL load failed while importing sqlite3 on python-qgis-ltr.bat Message-ID: Hi, When using the `python-qgis-ltr.bat` and trying to import sqlite3 I get an ImportError that dlls are not found. I'm on the next gen osgeo4w. I think that is because on py38 onwards dlls are not looked at from dirs in PATH. And since python-qgis-ltr uses python.exe from C:/osgeo4w/apps/python39 and not from C:/osgeo4w/bin where the sqlite3.dll is, it doesn't find it. Is this expected behavior? Maybe not a relevant question here but to get more familiar with the osgeo4w system: When is it suitable using these different python executables? How do they differ from each other? Thanks, Lauri -------------- next part -------------- An HTML attachment was scrubbed... URL: From trac_osgeo4w at osgeo.org Tue Jun 22 08:58:15 2021 From: trac_osgeo4w at osgeo.org (OSGeo4W) Date: Tue, 22 Jun 2021 15:58:15 -0000 Subject: [osgeo4w-dev] [osgeo4w] #682: MSI and EXE installers: different Python locale settings leads to issues with the Python console script editor Message-ID: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> #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 "", line 1, in 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 }}} -- Ticket URL: OSGeo4W OSGeo4W is the Windows installer and package environment for the OSGeo stack. From trac_osgeo4w at osgeo.org Tue Jun 22 10:05:50 2021 From: trac_osgeo4w at osgeo.org (OSGeo4W) Date: Tue, 22 Jun 2021 17:05:50 -0000 Subject: [osgeo4w-dev] [osgeo4w] #682: MSI and EXE installers: different Python locale settings leads to issues with the Python console script editor In-Reply-To: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> References: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> Message-ID: <067.ec4730e1aa1a74f84f0cf03d275c4bbd@osgeo.org> #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 PedroNGV): @andreaerdna This seems the issue I've reported here: https://github.com/qgis/QGIS/issues/41601 -- Ticket URL: OSGeo4W OSGeo4W is the Windows installer and package environment for the OSGeo stack. From trac_osgeo4w at osgeo.org Tue Jun 22 10:58:26 2021 From: trac_osgeo4w at osgeo.org (OSGeo4W) Date: Tue, 22 Jun 2021 17:58:26 -0000 Subject: [osgeo4w-dev] [osgeo4w] #682: MSI and EXE installers: different Python locale settings leads to issues with the Python console script editor In-Reply-To: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> References: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> Message-ID: <067.6fe2c06176d5219118ddd8b0330b7796@osgeo.org> #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 andreaerdna): Yes, most likely this is the same underlying reason that causes also the issue you reported, too. Probably also the issue fixed by https://github.com/qgis/QGIS/pull/43249 was due to the same reason. -- Ticket URL: OSGeo4W OSGeo4W is the Windows installer and package environment for the OSGeo stack. From trac_osgeo4w at osgeo.org Tue Jun 22 11:23:25 2021 From: trac_osgeo4w at osgeo.org (OSGeo4W) Date: Tue, 22 Jun 2021 18:23:25 -0000 Subject: [osgeo4w-dev] [osgeo4w] #682: MSI and EXE installers: different Python locale settings leads to issues with the Python console script editor In-Reply-To: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> References: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> Message-ID: <067.117f19ced0f06453c17e20a93d3afbce@osgeo.org> #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 jef): Please try adding ``set PYTHONUTF8=1`` to ``etc\ini\python3.bat`` and re- run ``qgis.bat --postinstall` from the OSGeo4W shell. -- Ticket URL: OSGeo4W OSGeo4W is the Windows installer and package environment for the OSGeo stack. From trac_osgeo4w at osgeo.org Tue Jun 22 12:13:52 2021 From: trac_osgeo4w at osgeo.org (OSGeo4W) Date: Tue, 22 Jun 2021 19:13:52 -0000 Subject: [osgeo4w-dev] [osgeo4w] #682: MSI and EXE installers: different Python locale settings leads to issues with the Python console script editor In-Reply-To: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> References: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> Message-ID: <067.74b53c9480303eaf166d9f361e6a53e5@osgeo.org> #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 "", line 1, in 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 }}} -- Ticket URL: OSGeo4W OSGeo4W is the Windows installer and package environment for the OSGeo stack. From trac_osgeo4w at osgeo.org Wed Jun 23 01:25:46 2021 From: trac_osgeo4w at osgeo.org (OSGeo4W) Date: Wed, 23 Jun 2021 08:25:46 -0000 Subject: [osgeo4w-dev] [osgeo4w] #682: MSI and EXE installers: different Python locale settings leads to issues with the Python console script editor In-Reply-To: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> References: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> Message-ID: <067.706cf82d02eec96f74afdee6bc67fbea@osgeo.org> #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 andreaerdna): It seems Python used in QGIS is not affected by the PYTHONUTF8 env var, while the Python used in OSGeo4W console is affected: **OSGeo4W old repositroy, OSGeo4W console**: {{{ F:\QGIS\OSGeo4W_3.18.1\qgis>python-qgis Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.environ['PYTHONUTF8'] Traceback (most recent call last): File "", line 1, in File "F:\QGIS\OSGEO4~1.1\qgis\apps\Python37\lib\os.py", line 678, in __getitem__ raise KeyError(key) from None KeyError: 'PYTHONUTF8' >>> import sys >>> sys.flags.utf8_mode 0 >>> import locale >>> locale.getpreferredencoding(False) 'cp1252' }}} {{{ F:\QGIS\OSGeo4W_3.18.1\qgis>set PYTHONUTF8=1 F:\QGIS\OSGeo4W_3.18.1\qgis>python-qgis Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.environ['PYTHONUTF8'] '1' >>> import sys >>> sys.flags.utf8_mode 1 >>> import locale >>> locale.getpreferredencoding(False) 'UTF-8' }}} {{{ F:\QGIS\OSGeo4W_3.18.1\qgis>set PYTHONUTF8=0 F:\QGIS\OSGeo4W_3.18.1\qgis>python-qgis Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.environ['PYTHONUTF8'] '0' >>> import sys >>> sys.flags.utf8_mode 0 >>> import locale >>> locale.getpreferredencoding(False) 'cp1252' }}} **OSGeo4W old repositroy, QGIS Python console**: {{{ sys.version '3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]' os.environ["PYTHONUTF8"] Traceback (most recent call last): File "F:\QGIS\OSGEO4~1.1\qgis\apps\Python37\lib\code.py", line 90, in runcode exec(code, self.locals) File "", line 1, in File "F:\QGIS\OSGEO4~1.1\qgis\apps\Python37\lib\os.py", line 678, in __getitem__ raise KeyError(key) from None KeyError: 'PYTHONUTF8' sys.flags.utf8_mode -1 import locale locale.getpreferredencoding() 'UTF-8' }}} {{{ sys.version '3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]' os.environ["PYTHONUTF8"] '1' sys.flags.utf8_mode -1 import locale locale.getpreferredencoding() 'UTF-8' }}} {{{ sys.version '3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]' os.environ["PYTHONUTF8"] '0' sys.flags.utf8_mode -1 import locale locale.getpreferredencoding() 'UTF-8' }}} -- Ticket URL: OSGeo4W OSGeo4W is the Windows installer and package environment for the OSGeo stack. From trac_osgeo4w at osgeo.org Wed Jun 23 01:39:54 2021 From: trac_osgeo4w at osgeo.org (OSGeo4W) Date: Wed, 23 Jun 2021 08:39:54 -0000 Subject: [osgeo4w-dev] [osgeo4w] #682: MSI and EXE installers: different Python locale settings leads to issues with the Python console script editor In-Reply-To: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> References: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> Message-ID: <067.7351cb434e6990fb03277f342333328a@osgeo.org> #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 andreaerdna): **OSGeo4W new repositroy, OSGeo4W console**: {{{ F:\QGIS\SourceDir\qgis>python-qgis Python 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.environ['PYTHONUTF8'] Traceback (most recent call last): File "", line 1, in File "F:\QGIS\SOURCE~1\qgis\apps\Python39\lib\os.py", line 679, in __getitem__ raise KeyError(key) from None KeyError: 'PYTHONUTF8' >>> import sys >>> sys.flags.utf8_mode 0 >>> import locale >>> locale.getpreferredencoding(False) 'cp1252' }}} {{{ F:\QGIS\SourceDir\qgis>set PYTHONUTF8=1 F:\QGIS\SourceDir\qgis>python-qgis Python 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.environ['PYTHONUTF8'] '1' >>> import sys >>> sys.flags.utf8_mode 1 >>> import locale >>> locale.getpreferredencoding(False) 'UTF-8' }}} {{{ F:\QGIS\SourceDir\qgis>set PYTHONUTF8=0 F:\QGIS\SourceDir\qgis>python-qgis Python 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.environ['PYTHONUTF8'] '0' >>> import sys >>> sys.flags.utf8_mode 0 >>> import locale >>> locale.getpreferredencoding(False) 'cp1252' }}} **OSGeo4W new repositroy, QGIS Python console**: {{{ sys.version '3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)]' os.environ['PYTHONUTF8'] 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 "", line 1, in File "F:\QGIS\SOURCE~1\qgis\apps\Python39\lib\os.py", line 679, in __getitem__ raise KeyError(key) from None KeyError: 'PYTHONUTF8' sys.flags.utf8_mode 0 import locale locale.getpreferredencoding() 'cp1252' }}} {{{ sys.version '3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)]' os.environ['PYTHONUTF8'] '1' sys.flags.utf8_mode 0 import locale locale.getpreferredencoding() 'cp1252' }}} {{{ sys.version '3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)]' os.environ['PYTHONUTF8'] '0' sys.flags.utf8_mode 0 import locale locale.getpreferredencoding() 'cp1252' }}} -- Ticket URL: OSGeo4W OSGeo4W is the Windows installer and package environment for the OSGeo stack. From trac_osgeo4w at osgeo.org Wed Jun 23 01:42:46 2021 From: trac_osgeo4w at osgeo.org (OSGeo4W) Date: Wed, 23 Jun 2021 08:42:46 -0000 Subject: [osgeo4w-dev] [osgeo4w] #682: MSI and EXE installers: different Python locale settings leads to issues with the Python console script editor In-Reply-To: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> References: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> Message-ID: <067.e6cb4bf13147090243286ca08d5ed820@osgeo.org> #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 jef): 3.18.1? 3.9.0? Why not 3.20.0 and 3.9.5? -- Ticket URL: OSGeo4W OSGeo4W is the Windows installer and package environment for the OSGeo stack. From trac_osgeo4w at osgeo.org Wed Jun 23 03:09:36 2021 From: trac_osgeo4w at osgeo.org (OSGeo4W) Date: Wed, 23 Jun 2021 10:09:36 -0000 Subject: [osgeo4w-dev] [osgeo4w] #682: MSI and EXE installers: different Python locale settings leads to issues with the Python console script editor In-Reply-To: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> References: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> Message-ID: <067.0724d1501b13a232effcdf4fd6345c69@osgeo.org> #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 PedroNGV): Replying to [comment:7 jef]: > 3.18.1? 3.9.0? Why not 3.20.0 and 3.9.5? I get the same with QGIS 3.20.0 and Python 3.9.5: {{{ sys.version '3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]' os.environ['PYTHONUTF8'] '1' sys.flags.utf8_mode 0 import locale locale.getpreferredencoding() 'cp1252' }}} -- Ticket URL: OSGeo4W OSGeo4W is the Windows installer and package environment for the OSGeo stack. From trac_osgeo4w at osgeo.org Wed Jun 23 06:58:33 2021 From: trac_osgeo4w at osgeo.org (OSGeo4W) Date: Wed, 23 Jun 2021 13:58:33 -0000 Subject: [osgeo4w-dev] [osgeo4w] #682: MSI and EXE installers: different Python locale settings leads to issues with the Python console script editor In-Reply-To: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> References: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> Message-ID: <067.826f878a9d542f34c3ec9b7dfd745013@osgeo.org> #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 andreaerdna): Replying to [comment:7 jef]: > 3.18.1? 3.9.0? Why not 3.20.0 and 3.9.5? QGIS 3.20.0 is not available in old OSGeo4W repository, so I can't compare the different behavior between new and old repository using the same QGIS version. -- Ticket URL: OSGeo4W OSGeo4W is the Windows installer and package environment for the OSGeo stack. From trac_osgeo4w at osgeo.org Wed Jun 23 17:33:40 2021 From: trac_osgeo4w at osgeo.org (OSGeo4W) Date: Thu, 24 Jun 2021 00:33:40 -0000 Subject: [osgeo4w-dev] [osgeo4w] #682: MSI and EXE installers: different Python locale settings leads to issues with the Python console script editor In-Reply-To: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> References: <052.50b010eac1ba59f10e0f1206b38669a2@osgeo.org> Message-ID: <067.40e8503ea423e034e41499905cfc66e2@osgeo.org> #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: closed Priority: major | Component: Package Version: | Resolution: fixed Keywords: | ------------------------+---------------------------- Changes (by jef): * status: new => closed * resolution: => fixed -- Ticket URL: OSGeo4W OSGeo4W is the Windows installer and package environment for the OSGeo stack.