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

FIx a crash when starting pronterface due to locale settings #1015

Merged
merged 1 commit into from
Sep 24, 2019

Conversation

joerih
Copy link
Contributor

@joerih joerih commented Aug 30, 2019

When starting pronterface on Windows 10 (1903 18362.296), wxWidgets
throws an error due to inconsistent locale settings:

Traceback (most recent call last):
File "pronterface.py", line 62, in
app = PronterApp(False)
File "Printrun\printrun\pronterface.py", line 2396, in init
self.mainwindow = PronterWindow(self)
File "Printrun\printrun\pronterface.py", line 187, in init
self.SetIcon(wx.Icon(iconfile("pronterface.png"), wx.BITMAP_TYPE_PNG))
wx._core.wxAssertionError: C++ assertion "strcmp(setlocale(LC_ALL, NULL), "C") == 0" failed at ....\src\common\intl.cpp(1579) in wxLocale::GetInfo(): You probably called setlocale() directly instead of using wxLocale and now there is a mismatch between C/C++ and Windows locale.

Fix this issue by specifying the locale on the pronterface app using wxLocale,
as suggested by the assertion.

When starting pronterface on Windows 10 (1903 18362.296), wxWidgets
throws an error due to inconsistent locale settings:

Traceback (most recent call last):
  File "pronterface.py", line 62, in <module>
    app = PronterApp(False)
  File "Printrun\printrun\pronterface.py", line 2396, in __init__
    self.mainwindow = PronterWindow(self)
  File "Printrun\printrun\pronterface.py", line 187, in __init__
    self.SetIcon(wx.Icon(iconfile("pronterface.png"), wx.BITMAP_TYPE_PNG))
wx._core.wxAssertionError: C++ assertion "strcmp(setlocale(LC_ALL, NULL), "C") == 0" failed at ..\..\src\common\intl.cpp(1579) in wxLocale::GetInfo(): You probably called setlocale() directly instead of using wxLocale and now there is a mismatch between C/C++ and Windows locale.

Fix this issue by specifying the locale on the pronterface app using wxLocale,
as suggested by the assertion.
@kliment kliment merged commit 9a09e2d into kliment:master Sep 24, 2019
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.

2 participants