nvda
911d712b - Fix NVDA crash when formatting a timestamp of a log entry under some versions of Universal CRT (#12250)

Commit
4 years ago
Fix NVDA crash when formatting a timestamp of a log entry under some versions of Universal CRT (#12250) Under some versions of Universal CRT Python can crash when formatting time with time.localtime and locale is set to a language which contains underscore it its name. For users this manifests in a crash of NVDA since default log formatter attempts to format current time with time.localtime when writing anything to the log. WX Python no longer tries to set Python locale to an nonexistent one when creating an instance of wx.app. While this is not necessary any longer when time.localtime is not used we are managing locale ourselves in languageHandler so it makes sense to do it just in one place. When formatting time of the log entries time.localtime is not used any more * Backport of `InitLocale` from Wx Python 4.1.2 to workaround crash encountered under particular versions of Universal CRT. * Custom implementation of `formatTime` for log formatter using win32 API calls to avoid crashes under Server 2019 and Windows 10 1809 * Lint for winKernel: - Remove star imports - Remove duplicate definition of openProcess * logHandler: move import of winKernel to the top of the file and remove unused imports. Co-authored-by: buddsean <sean@nvaccess.org>
Author
Parents
Loading