Error Message from wx editor

I'm getting this traceback:

-------------------Start of traceback---------------------
Traceback (most recent call last):
  File "I:\python\Lib\site-packages\wxPython\lib\editor\editor.py",
line 450,
in OnMotion
    if event.LeftIsDown() and self.HasCapture():
  
File "I:\python\Lib\site-packages\wxPython\events.py", line 275, in
LeftIsDown
    val = eventsc.wxMouseEvent_LeftIsDown(self, *_args, **_kwargs)

wxPython.wxc.wxPyAssertionError: C++ assertion "wxAssertFailure" failed
in
  c:\PROJECTS\wx\src\common\choiccmn.cpp(54): invalid string in
wxChoice::SetStringSelection

-------------------End of traceback---------------------

I've got wxPython 2.4.1.2 running on Python 2.2.3, Win NT 4.0 sp6.

The c:\Projects ... folder doesn't even exist on my machine, and this
traceback doesn't give any indication of where in my code, (not small)
I did whatever I did to cause this error.

TIA for any ideas.

Al

achrist@easystreet.com wrote:

I'm getting this traceback:

-------------------Start of traceback---------------------
Traceback (most recent call last):
  File "I:\python\Lib\site-packages\wxPython\lib\editor\editor.py",
line 450,
in OnMotion
    if event.LeftIsDown() and self.HasCapture():
  
File "I:\python\Lib\site-packages\wxPython\events.py", line 275, in
LeftIsDown
    val = eventsc.wxMouseEvent_LeftIsDown(self, *_args, **_kwargs)

wxPython.wxc.wxPyAssertionError: C++ assertion "wxAssertFailure" failed
in c:\PROJECTS\wx\src\common\choiccmn.cpp(54): invalid string in
wxChoice::SetStringSelection

-------------------End of traceback---------------------

I've got wxPython 2.4.1.2 running on Python 2.2.3, Win NT 4.0 sp6.

The c:\Projects ... folder doesn't even exist on my machine, and this

Since it is an assertion in the C++ code then the pathname refers to the machine where the C++ code was compiled, mine in this case.

traceback doesn't give any indication of where in my code, (not small)
I did whatever I did to cause this error.

Assertion errors in the C++ code are turned into Python exceptions the next time control returns from C++ to Python, and that can be either upon returning from the current stack frame or (less likely) the next time an event handler or other callback is executed. Because of the nature of the layering of C++ and Python stackframes the traceback will be printed the next time control returns from Python back to C++, you you effectively only get one layer of Python in the traceback (I hope to be able to fix this in 2.5.x)

However there *are* some clues in the trackback, although I agree that it is not as helpful as it would be if you had nothing but Python code. We know that the C++ error happened in wxChoice::SetStringSelection so the first place to look is anywhere that you are using a wxChoice (or a wxComboBox since it derives from wxChoice on Windows.) The traceback also implicates the EVT_MOTION handler in editor.py, but I think in this case it is one of those rarer cases described above of some other event handler being the "next time" we try returning from C++ to Python because of something in one event handler causing another event to be sent.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!