This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author speleo3
Recipients paul.moore, speleo3, steve.dower, tim.golden, zach.ware
Date 2020-03-26.12:16:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1585224969.87.0.649895216825.issue40075@roundup.psfhosted.org>
In-reply-to
Content
The attached demo application runs a Tkinter GUI and a PyQt GUI in the same thread. PyQt owns the main loop and keeps updating the Tkinter instance by calling `update()`.

On Windows, when binding a "<Configure>" event, resizing the Tk window will lead to a crash:

```
Fatal Python error: PyEval_RestoreThread: NULL tstate

Current thread 0x00001f1c (most recent call first):
  File "qt_tk_demo.py", line 50 in <module>
```

This crash happens in `_tkinter.c` in `PythonCmd` inside the `ENTER_PYTHON` macro.

The issue can be fixed by using `PyGILState_Ensure` and `PyGILState_Release` instead of the `ENTER_PYTHON` macro inside the `PythonCmd` function.
History
Date User Action Args
2020-03-26 12:16:09speleo3setrecipients: + speleo3, paul.moore, tim.golden, zach.ware, steve.dower
2020-03-26 12:16:09speleo3setmessageid: <1585224969.87.0.649895216825.issue40075@roundup.psfhosted.org>
2020-03-26 12:16:09speleo3linkissue40075 messages
2020-03-26 12:16:09speleo3create