diff --git a/.github/issue_template.md b/.github/issue_template.md index ff5a5ed9..c9b5f8ef 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -11,8 +11,12 @@ **Description of the problem**: - + + +
+ Code Example (click to expand) ```python # Put code sample here ``` +
diff --git a/CHANGES.rst b/CHANGES.rst index 4482decc..7686d78d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -28,6 +28,13 @@ New and improved in this release: Python environment used for the build. A dependency has been added to requirements/devel.txt to help ensure that the correct version is installed. +* Change wx.App.InitLocale to just do `locale.setlocale(locale.LC_ALL, "C")` + to undo what Python (3.8+ on Windows) does. This lets wxWidgets start with an + uninitialized locale as it expects. (#1637) + +* Fixed issues related to `time_t` being treated as a 32-bit value on Windows. + (#1910) + 4.1.1 "An attitude of gratitude" diff --git a/demo/Timer.py b/demo/Timer.py index 3ca95bb5..673bed27 100644 --- a/demo/Timer.py +++ b/demo/Timer.py @@ -219,6 +219,12 @@ class TestPanel(sp.ScrolledPanel): self.log.write("got wx.PyTimer event\n") + def ShutdownDemo(self): + for t in ['t1', 't2', 't3', 't4']: + if hasattr(self, t): + print('Stopping:', t) + timer = getattr(self, t) + timer.Stop() #---------------------------------------------------------------------- diff --git a/etg/app.py b/etg/app.py index cbdf1191..ccb4cb6c 100644 --- a/etg/app.py +++ b/etg/app.py @@ -521,33 +521,28 @@ def run(): PyFunctionDef('InitLocale', '(self)', doc="""\ - Try to ensure that the C and Python locale is in sync with the wxWidgets - locale on Windows. If you have troubles from the default behavior of this - method you can override it in a derived class to behave differently. - Please report the problem you encountered. + Starting with version 3.8 on Windows, Python is now setting the locale + to what is defined by the system as the default locale. This causes + problems with wxWidgets which expects to be able to manage the locale + via the wx.Locale class, so the locale will be reset here to be the + default "C" locale settings. + + If you have troubles from the default behavior of this method you can + override it in a derived class to behave differently. Please report + the problem you encountered. """, body="""\ - self.ResetLocale() - if 'wxMSW' in PlatformInfo: + if _sys.platform.startswith('win') and _sys.version_info > (3,8): import locale - try: - lang, enc = locale.getdefaultlocale() - self._initial_locale = wx.Locale(lang, lang[:2], lang) - locale.setlocale(locale.LC_ALL, lang) - except (ValueError, locale.Error) as ex: - target = wx.LogStderr() - orig = wx.Log.SetActiveTarget(target) - wx.LogError("Unable to set default locale: '{}'".format(ex)) - wx.Log.SetActiveTarget(orig) + locale.setlocale(locale.LC_ALL, "C") """), PyFunctionDef('ResetLocale', '(self)', doc="""\ - Release the wx.Locale object created in :meth:`InitLocale`. - This should reset the application's locale to the previous settings. + This method is now a NOP and will be deprecated. """, body="""\ - self._initial_locale = None + pass """), PyFunctionDef('Get', '()', isStatic=True, diff --git a/etg/defs.py b/etg/defs.py index e8bf9ffb..167e0726 100644 --- a/etg/defs.py +++ b/etg/defs.py @@ -73,7 +73,7 @@ def run(): td = module.find('wxUIntPtr') module.insertItemAfter(td, etgtools.TypedefDef(type='wchar_t', name='wxUChar')) module.insertItemAfter(td, etgtools.TypedefDef(type='wchar_t', name='wxChar')) - module.insertItemAfter(td, etgtools.TypedefDef(type='long', name='time_t')) + module.insertItemAfter(td, etgtools.TypedefDef(type='wxInt64', name='time_t')) module.insertItemAfter(td, etgtools.TypedefDef(type='long long', name='wxFileOffset')) module.insertItemAfter(td, etgtools.TypedefDef(type='SIP_SSIZE_T', name='ssize_t')) module.insertItemAfter(td, etgtools.TypedefDef(type='unsigned char', name='byte', pyInt=True)) diff --git a/etg/intl.py b/etg/intl.py index 09a231d4..fa90d93d 100644 --- a/etg/intl.py +++ b/etg/intl.py @@ -61,6 +61,8 @@ def run(): import os _localedir = os.path.join(os.path.dirname(__file__), "locale") if os.path.exists(_localedir): + if isinstance(_localedir, (bytes, bytearray)): + _localedir = _localedir.decode(_sys.getfilesystemencoding()) Locale.AddCatalogLookupPathPrefix(_localedir) del os #---------------------------------------------------------------------------- diff --git a/wx/lib/agw/aui/framemanager.py b/wx/lib/agw/aui/framemanager.py index 44910ba5..69ee4d82 100644 --- a/wx/lib/agw/aui/framemanager.py +++ b/wx/lib/agw/aui/framemanager.py @@ -3761,7 +3761,7 @@ def GetNotebookRoot(panes, notebook_id): def EscapeDelimiters(s): """ - Changes ``;`` into ``\`` and ``|`` into ``\|`` in the input string. + Changes ``;`` into ``\\`` and ``|`` into ``|\\`` in the input string. :param string `s`: the string to be analyzed.