diff options
| author | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-08-18 12:24:51 +0200 |
|---|---|---|
| committer | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-08-25 09:21:33 +0200 |
| commit | 35c96115cb4fb71fcc263abf43099dd712187080 (patch) | |
| tree | 035aca30a2fb0afa5277d00c05b8aadf0e286595 /sources/pyside6/doc/tutorials | |
| parent | f3f8939f347370dbd2738ecb536543bf8cff4a09 (diff) | |
PySide: Fix QLocale::system() in macOS
- QSystemLocale for macOS relies on CFBundleAllowMixedLocalizations/
CFBundleLocalizations in the Info.plist file for the C++
Application bundle, as seen from
1d3ae5f0e98f252214d20ce8561533891311a71f. Python being an
interpreted language, there is no application bundle unless the
application is deployed. As such a Python application in macOS
relies on the Info.plist file of the Python interepreter. This
Info.plist file is a read-only file and hence it is not
possible/recommended to patch the Info.plist file of the Python
interpreter at runtime.
The issue has been raised upstream in CPython and can be tracked
here: https://github.com/python/cpython/issues/108269
- A possible solution/hack is therefore to use to POSIX environment
variables for macOS, for Qt for Python. This is also what the Python
locale module does.
See: https://github.com/python/cpython/blob/3.11/Lib/locale.py#L534
For other Unix systems, QLocale::system() uses the POSIX environment
variables, just like Python's locale module.
- For Windows and Linux, QSystem::locale() remains unchanged.
- The idea here is to obtain the system locale from the Python locale
module, and use the result to initialize and return a QLocale
object.
- As an extra, for qrunnable_create fix the typo - snipped to
snippet.
Fixes: PYSIDE-2419
Pick-to: 6.5 6.2
Change-Id: I12b16e824ddba21d1ebcd0695262c1dc0cc61eb2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'sources/pyside6/doc/tutorials')
0 files changed, 0 insertions, 0 deletions
