enthought/traitsui

`key_bindings.py` example hangs with macOS / PySide2 / Python3.6

Closed this issue · 3 comments

I'm seeing a hang on macOS 11.6.4 when running the docs/source/traitsui_user_manual/examples/key_bindings.py script under Python 3.6 + PySide2, using the latest EDM packages.

After creating a fresh EDM environment from the main branch with:

python etstool.py install --toolkit=pyside2

If I then run the key_bindings.py script using:

edm run -e traitsui-test-3.6-pyside2 -- python docs/source/traitsui_user_manual/examples/key_bindings.py

I see the "Python" icon in my dock, and the CPU goes to 100%, but no window opens, and a Ctrl-C fails to stop the hanging application.

This is not specific to key_bindings.py: the enum_editor.py example also hangs, as does the test suite (from python etstool.py test --toolkit=pyside2). The test suite hangs at test_copy_item in TestTabularModel.

a Ctrl-C fails to stop the hanging application

Correction: this does work, at least sometimes. I think I saw a case where it wasn't working, but may have been mistaken.

Closing: this is a known problem, and the solution is to use export QT_MAC_WANTS_LAYER=1.