Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New InitLocale implementation #1702

Merged
merged 5 commits into from
Jun 29, 2020
Merged

New InitLocale implementation #1702

merged 5 commits into from
Jun 29, 2020

Conversation

RobinD42
Copy link
Member

Fixes #1440 and probably some others

@RobinD42 RobinD42 merged commit 7ac363c into master Jun 29, 2020
@wossx
Copy link

wossx commented Jul 2, 2020

import platform
print(platform.platform())
import sys
print(sys.version)
import locale
print(locale.getdefaultlocale(), locale.getlocale())
import wx
print(wx.version(), end='\n\n')

app = wx.App()

For me it causes this on Windows 7-64:

Windows-7-6.1.7601-SP1
3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit (Intel)]
('hu_HU', 'cp1250') ('Hungarian_Hungary', '1250')
4.1.1a1.dev4845+73f75ea3 msw (phoenix) wxWidgets 3.1.4

Traceback (most recent call last):
  File "d:\env\develop\lib\site-packages\wx\core.py", line 2204, in OnPreInit
    self.InitLocale()
  File "d:\env\develop\lib\site-packages\wx\core.py", line 2271, in InitLocale
    locale.setlocale(locale.LC_ALL, lang)
  File "D:\Python38\lib\locale.py", line 608, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

And Python 3.6 :

Windows-7-6.1.7601-SP1
3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)]
('hu_HU', 'cp1250') (None, None)
4.1.1a1.dev4845+73f75ea3 msw (phoenix) wxWidgets 3.1.4

Traceback (most recent call last):
  File "d:\Python36\lib\site-packages\wx\core.py", line 2204, in OnPreInit
    self.InitLocale()
  File "d:\Python36\lib\site-packages\wx\core.py", line 2271, in InitLocale
    locale.setlocale(locale.LC_ALL, lang)
  File "d:\Python36\lib\locale.py", line 598, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

On Windows 10-64 works fine.

Windows-10-10.0.18362-SP0
3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit (Intel)]
('hu_HU', 'cp1250') ('Hungarian_Hungary', '1250')
4.1.1a1.dev4845+73f75ea3 msw (phoenix) wxWidgets 3.1.4

@RobinD42
Copy link
Member Author

RobinD42 commented Jul 2, 2020

I'll add locale.Error to the exception handler.

@RobinD42 RobinD42 deleted the locale-stuff branch July 2, 2020 23:02
@RobinD42
Copy link
Member Author

This pull request has been mentioned on Discuss wxPython. There might be relevant details there:

https://discuss.wxpython.org/t/a-few-more-windows-locale-related-remarks/34788/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unknown Locale
2 participants