[issue40075] _tkinter PythonCmd fails to acquire GIL

2020-09-29 Thread Thomas Holder
Thomas Holder added the comment: All good, thanks for opening PR 22453! I'll close my old PR. -- ___ Python tracker ___ ___ Python-

[issue40075] _tkinter PythonCmd fails to acquire GIL

2020-09-29 Thread E. Paine
Change by E. Paine : -- pull_requests: +21482 pull_request: https://github.com/python/cpython/pull/22453 ___ Python tracker ___ ___

[issue40075] _tkinter PythonCmd fails to acquire GIL

2020-09-29 Thread E. Paine
E. Paine added the comment: I do think we should close the existing PR (TBH, I completely forgot about this issue). Briefly looking again at the issue, it does indeed look like the GIL hasn't seen the thread before the attempted call to restore the tstate (as Steve said). If its alright with

[issue40075] _tkinter PythonCmd fails to acquire GIL

2020-09-29 Thread Thomas Holder
Thomas Holder added the comment: I finally managed to test tstate_acquire.diff and it works perfectly! Should I close my pull request? Or update it with your patch? -- ___ Python tracker ___

[issue40075] _tkinter PythonCmd fails to acquire GIL

2020-07-30 Thread E. Paine
E. Paine added the comment: Thanks Steve for your explanation. I had a quick experiment with the ENTER_PYTHON definition and initially just added a call to PyThreadState_Get if the tstate was NULL. This still crashed the interpreter with the following error (which I think reaffirms Steve's e

[issue40075] _tkinter PythonCmd fails to acquire GIL

2020-07-30 Thread Thomas Holder
Thomas Holder added the comment: Attaching an even simpler example which doesn't use PyQt. It shows a native Windows dialog using ctypes. I could not reproduce the crash without showing any non-tk dialog. Steve's explanation sounds plausible. -- Added file: https://bugs.python.org/f

[issue40075] _tkinter PythonCmd fails to acquire GIL

2020-07-29 Thread Steve Dower
Steve Dower added the comment: At a glance, it looks like ENTER_PYTHON will *restore* the GIL on the current thread, but it may be coming in on a thread that's never seen the GIL before. "The GIL" is actually the Python thread state, which is actually a per-thread data structure that's eithe

[issue40075] _tkinter PythonCmd fails to acquire GIL

2020-07-29 Thread E. Paine
E. Paine added the comment: Sorry for taking so long to do something with this issue. Can you please explain *why* (mostly because I don't really have a clue) acquiring the GIL fixes this crash (I am not disputing that it does - I have compared the current 3.9 branch against yours and confir

[issue40075] _tkinter PythonCmd fails to acquire GIL

2020-03-28 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue40075] _tkinter PythonCmd fails to acquire GIL

2020-03-26 Thread Thomas Holder
Change by Thomas Holder : -- keywords: +patch pull_requests: +18538 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19178 ___ Python tracker ___ __

[issue40075] _tkinter PythonCmd fails to acquire GIL

2020-03-26 Thread Thomas Holder
New submission from Thomas Holder : 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 "" event, resizing the Tk window will lead to a crash: ``