From f280855a030cf85ac54b95c9deda302bd18a2776 Mon Sep 17 00:00:00 2001 From: cbeytas Date: Wed, 21 Nov 2018 14:30:17 -0500 Subject: [PATCH] Set wx.Locale to avoid assertion errors If customtreectrl.py or hypertreelist.py modules are run the latest wxPython versions will throw Assertion errors if the locale is not set. 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. Things are going to break, please only change locale by creating wxLocale objects to avoid this! --- wx/lib/agw/customtreectrl.py | 2 +- wx/lib/agw/hypertreelist.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wx/lib/agw/customtreectrl.py b/wx/lib/agw/customtreectrl.py index d10a0182..bfaa0419 100644 --- a/wx/lib/agw/customtreectrl.py +++ b/wx/lib/agw/customtreectrl.py @@ -8753,7 +8753,7 @@ if __name__ == '__main__': # our normal wxApp-derived class, as usual app = wx.App(0) - + locale = wx.Locale(wx.LANGUAGE_DEFAULT) frame = MyFrame(None) app.SetTopWindow(frame) frame.Show() diff --git a/wx/lib/agw/hypertreelist.py b/wx/lib/agw/hypertreelist.py index 6adaf4ad..7e89d21f 100644 --- a/wx/lib/agw/hypertreelist.py +++ b/wx/lib/agw/hypertreelist.py @@ -4955,7 +4955,7 @@ if __name__ == '__main__': # our normal wxApp-derived class, as usual app = wx.App(0) - + locale = wx.Locale(wx.LANGUAGE_DEFAULT) frame = MyFrame(None) app.SetTopWindow(frame) frame.Show()