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
[Bug] wx._core.wxAssertionError #5687
Comments
0.17.2 ? >>> import PySimpleGUIWx as sg
>>> sg.version
'0.17.1 Released 7-Jun-2020'
4.1.2 ? or 4.1.1 ?
Any code to demo your issue ? |
F:\python36>scripts\pip3 freeze Error log of calling main() unction in PySimpleGUIWx module:
|
Just find something
or
Refer wxWidgets/Phoenix#1515 |
I got different exception in my WIN10
d:\>python
Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import PySimpleGUIWx as sg
>>> sg.version
'0.17.1 Released 7-Jun-2020'
>>> sg.main()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Software\Python\lib\site-packages\PySimpleGUIWx\PySimpleGUIWx.py", line 8021, in main
event, values = window.Read()
File "C:\Software\Python\lib\site-packages\PySimpleGUIWx\PySimpleGUIWx.py", line 3070, in Read
results = self._read(timeout=timeout, timeout_key=timeout_key)
File "C:\Software\Python\lib\site-packages\PySimpleGUIWx\PySimpleGUIWx.py", line 3092, in _read
self.Show()
File "C:\Software\Python\lib\site-packages\PySimpleGUIWx\PySimpleGUIWx.py", line 2975, in Show
StartupTK(self)
File "C:\Software\Python\lib\site-packages\PySimpleGUIWx\PySimpleGUIWx.py", line 5442, in StartupTK
PackFormIntoFrame(window, vsizer, window)
File "C:\Software\Python\lib\site-packages\PySimpleGUIWx\PySimpleGUIWx.py", line 4926, in PackFormIntoFrame
text_ctrl.Bind(wx.EVT_TEXT_ENTER, element._ReturnKeyHandler)
File "C:\Software\Python\lib\site-packages\wx\core.py", line 1459, in _EvtHandler_Bind
event.Bind(self, id, id2, handler)
File "C:\Software\Python\lib\site-packages\wx\core.py", line 1530, in Bind
target.Connect(id1, id2, et, function)
wx._core.wxAssertionError: C++ assertion ""HasFlag(0x0400)"" failed at ..\..\src\common\textcmn.cpp(1210) in wxTextCtrlBase::OnDynamicBind(): Must have wxTE_PROCESS_ENTER for wxEVT_TEXT_ENTER to work After I downgrade my wxpython to 4.0.7, then it work, but failed to close window. d:\>pip install wxpython==4.0.7
Collecting wxpython==4.0.7
Using cached wxPython-4.0.7-cp38-cp38-win_amd64.whl (22.9 MB)
Requirement already satisfied: six in c:\software\python\lib\site-packages (from wxpython==4.0.7) (1.16.0)
Requirement already satisfied: numpy in c:\software\python\lib\site-packages (from wxpython==4.0.7) (1.23.1)
Requirement already satisfied: pillow in c:\software\python\lib\site-packages (from wxpython==4.0.7) (9.2.0)
Installing collected packages: wxpython
Attempting uninstall: wxpython
Found existing installation: wxPython 4.1.1
Uninstalling wxPython-4.1.1:
Successfully uninstalled wxPython-4.1.1
Successfully installed wxpython-4.0.7
d:\>python
Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import PySimpleGUIWx as sg
>>> sg.main()
Exit {0: '', 1: '', 2: 'Source', 'Browse': None, 3: 'Dest', 'Browse0': None, 4: False, 5: False, 6: 'Multiline Input', '_COMBO_': 'Combo 2', '_SPIN_': 'Spin a'}
>>> |
Type of Issue (Enhancement, Error, Bug, Question)
Bug
Operating System
Windows 10
PySimpleGUI Port (tkinter, Qt, Wx, Web)
Wx
Versions
Version information can be obtained by calling
sg.main_get_debug_data()
Or you can print each version shown in ()
Python version (
sg.sys.version
)3.6.8
PySimpleGUI Version (
sg.__version__
)4.60.1
GUI Version (tkinter (
sg.tclversion_detailed
), PySide2, WxPython, Remi)WxPython 4.1.2
Your Experience In Months or Years (optional)
Years Python programming experience
Years Programming experience overall
Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)
yes
Anything else you think would be helpful?
Troubleshooting
These items may solve your problem. Please check those you've done by changing - [ ] to - [X]
Detailed Description
wx._core.wxAssertionError: C++ assertion "strcmp(setlocale(0, 0), "C") == 0" failed at ....\src\common\intl.cpp(1694) 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!
Code To Duplicate
A short program that isolates and demonstrates the problem (Do not paste your massive program, but instead 10-20 lines that clearly show the problem)
This pre-formatted code block is all set for you to paste in your bit of code:
# Paste your code here
Screenshot, Sketch, or Drawing
Watcha Makin?
If you care to share something about your project, it would be awesome to hear what you're building.
The text was updated successfully, but these errors were encountered: