From eef9f3a58d53a0c94ab297f30f6b599e1bf4899b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20St=C3=B6r?= Date: Tue, 18 Jan 2022 22:30:28 +0100 Subject: [PATCH] Fix the Windows + Python 3.8+ + wxPython 4.1 locale issue Fixes #78 --- Main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Main.py b/Main.py index da25fcf..b58a0d0 100644 --- a/Main.py +++ b/Main.py @@ -13,6 +13,10 @@ import json import images as images from serial import SerialException from serial.tools import list_ports +import locale + +# see https://discuss.wxpython.org/t/wxpython4-1-1-python3-8-locale-wxassertionerror/35168 +locale.setlocale(locale.LC_ALL, 'C') __version__ = "5.0.0" __flash_help__ = ''' @@ -416,6 +420,8 @@ class MySplashScreen(wx.adv.SplashScreen): # ---------------------------------------------------------------------------- class App(wx.App, wx.lib.mixins.inspection.InspectionMixin): def OnInit(self): + # see https://discuss.wxpython.org/t/wxpython4-1-1-python3-8-locale-wxassertionerror/35168 + self.ResetLocale() wx.SystemOptions.SetOption("mac.window-plain-transition", 1) self.SetAppName("NodeMCU PyFlasher")