error when using latest wxPython
Added by Jim Pulokas over 18 years ago
The most recent release of wxPython, version 2.6.3.2, will cause an error when you try to start Leginon. It will look something like this:
wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed in
../src/gtk/choice.cpp(445): wxChoice: invalid index in GetString()
We will fix this in the next Leginon release, but if you need it fixed now and do not want to revert to an older wxPython, you can do the following hack:
Edit the file (depending on you installation, you may have to find it somewhere else):
/usr/lib/python/site-packages/Leginon/gui/wx/SetupWizard.py
line 292 says:
selection = self.sessionchoice.GetString(0)Replace that with the following four lines:
try: selection = self.sessionchoice.GetString(0) except: selection = ""
Be sure to keep indentation consistent with existing indentation to prevent syntax errors. ("try..." is indented 3 tabs, "selection =..." is indented 4 tabs, etc).
This will catch the exception and set selection to the empty string which older versions of wxPython seem to have done automatically.