diff options
author | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-10-17 15:54:09 +0200 |
---|---|---|
committer | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-10-18 16:13:33 +0200 |
commit | a0050803761563b3e7db49dd553c13cfc4802eaa (patch) | |
tree | 9dc5e55a7ffe7ea51efccffdfe92c4b759117e62 /sources/pyside6/PySide6/QtCore/typesystem_core_common.xml | |
parent | 8acce676f0c3af32c988fd3f35e77c94b234873e (diff) |
PySide: Fix QLocale crash on macOS
- Reproducible in macOS terminal/QtCreator because the environment
does not explicitly set the locale unless the locale is changed.
- If the locale of the system has not been changed, then the Python
locale module's getLocale() returns 'None' as the language code. In
this case, use the POSIX locale or 'C' locale as the default as stated
in the Python locale module's documentation:
``
According to POSIX, a program which has not called
setlocale(LC_ALL, '') runs using the portable 'C' locale.
``
- This issue does not exist in VSCode because VSCode set the locale
in its terminal.
Pick-to: 6.6 6.5
Fixes: PYSIDE-2485
Change-Id: I23ccfa0ef59912ad950143d4a1080c5a201a4865
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/PySide6/QtCore/typesystem_core_common.xml')
-rw-r--r-- | sources/pyside6/PySide6/QtCore/typesystem_core_common.xml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml index 82f4f286b..e533b8fdc 100644 --- a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml +++ b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml @@ -1352,7 +1352,10 @@ .. note:: Qt for Python on macOS will not reflect the user's region and language preferences though QLocale::system(), but will instead reflect the environment - variables POSIX uses to specify locale, similar to Python's locale module. + variables POSIX uses to specify locale, similar to Python's locale module. If the + system locale cannot be determined, which can be due to none of the variables 'LC_ALL', + 'LC_CTYPE', 'LANG' or 'LANGUAGE' being set by your environment, then the default POSIX + locale or 'C' locale is returned. See also c(). </inject-documentation> |