enthought / enthought/pyface

wx._core.wxAssertionError in multiple examples

Open
#645 0 comments 0 reactions 0 assignees View on GitHub
toolkit: Wx
Dominant language
Python
Stars
115
Forks
54
PR merge metrics
No merged PRs in 30d

Description

When starting examples, after you close the GUI window in multiple example the same error is output to the command line.

For example running and closing python_editor_application.py yields:

```
$ python python_editor_application.py
08:19:28 AM: Debug: Adding duplicate image handler for 'Windows bitmap file'
08:19:28 AM: Debug: Adding duplicate image handler for 'Windows bitmap file'
08:19:28 AM: Debug: Adding duplicate image handler for 'Windows bitmap file'
Wx control not destroyed cleanly
Traceback (most recent call last):
File "/Users/aayres/.edm/envs/wx-env-pyface/lib/python3.6/site-packages/traitsui/wx/toolkit.py", line 434, in destroy_control
control.Destroy()
File "/Users/aayres/.edm/envs/wx-env-pyface/lib/python3.6/site-packages/traitsui/wx/helper.py", line 323, in Destroy
super().Destroy()
wx._core.wxAssertionError: C++ assertion "GetEventHandler() == this" failed at /Users/robind/projects/bb2/dist-osx-py36/build/ext/wxWidgets/src/common/wincmn.cpp(478) in ~wxWindowBase(): any pushed event handlers must have been removed
Wx control not destroyed cleanly
Traceback (most recent call last):
File "/Users/aayres/.edm/envs/wx-env-pyface/lib/python3.6/site-packages/traitsui/wx/toolkit.py", line 434, in destroy_control
control.Destroy()
File "/Users/aayres/.edm/envs/wx-env-pyface/lib/python3.6/site-packages/traitsui/wx/helper.py", line 323, in Destroy
super().Destroy()
wx._core.wxAssertionError: C++ assertion "GetEventHandler() == this" failed at /Users/robind/projects/bb2/dist-osx-py36/build/ext/wxWidgets/src/common/wincmn.cpp(478) in ~wxWindowBase(): any pushed event handlers must have been removed
```

The same error occurs when closing an editor in drag_test.py.
When running the example in https://github.com/enthought/pyface/tree/master/examples/workbench
the last line of traceback is the same but the example fails to run altogether:

```
$ python run.py
09:54:48 AM: Debug: Adding duplicate image handler for 'Windows bitmap file'
09:54:48 AM: Debug: Adding duplicate image handler for 'Windows bitmap file'
09:54:48 AM: Debug: Adding duplicate image handler for 'Windows bitmap file'
Traceback (most recent call last):
File "run.py", line 66, in
main(sys.argv)
File "run.py", line 44, in main
window.open()
File "/Users/aayres/Desktop/pyface/pyface/workbench/workbench_window.py", line 152, in open
self._create()
File "/Users/aayres/Desktop/pyface/pyface/ui/wx/application_window.py", line 128, in _create
self._create_trim_widgets(self.control)
File "/Users/aayres/Desktop/pyface/pyface/i_application_window.py", line 151, in _create_trim_widgets
self._create_menu_bar(parent)
File "/Users/aayres/Desktop/pyface/pyface/ui/wx/application_window.py", line 77, in _create_menu_bar
menu_bar = self.menu_bar_manager.create_menu_bar(parent)
File "/Users/aayres/Desktop/pyface/pyface/workbench/action/menu_bar_manager.py", line 39, in create_menu_bar
parent, controller=controller
File "/Users/aayres/Desktop/pyface/pyface/ui/wx/action/menu_bar_manager.py", line 44, in create_menu_bar
menu = item.create_menu(parent, controller)
File "/Users/aayres/Desktop/pyface/pyface/ui/wx/action/menu_manager.py", line 56, in create_menu
return _Menu(self, parent, controller)
File "/Users/aayres/Desktop/pyface/pyface/ui/wx/action/menu_manager.py", line 106, in __init__
self.refresh()
File "/Users/aayres/Desktop/pyface/pyface/ui/wx/action/menu_manager.py", line 147, in refresh
parent, group, previous_non_empty_group
File "/Users/aayres/Desktop/pyface/pyface/ui/wx/action/menu_manager.py", line 204, in _add_group
item.add_to_menu(parent, self, self._controller)
File "/Users/aayres/Desktop/pyface/pyface/ui/wx/action/menu_manager.py", line 66, in add_to_menu
id = sub.GetId()
AttributeError: '_Menu' object has no attribute 'GetId'
Error in atexit._run_exitfuncs:
wx._core.wxAssertionError: C++ assertion "GetEventHandler() == this" failed at /Users/robind/projects/bb2/dist-osx-py36/build/ext/wxWidgets/src/common/wincmn.cpp(478) in ~wxWindowBase(): any pushed event handlers must have been removed
```

likewise there are similar errors for expandable.py, node_tree.py, tool_palette.py, traitsui_window.py, tree.py, and wizard.py (wizard.py error occurs when window is closed)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.