classification
Title: Fatal Python error: PyEval_RestoreThread: NULL tstate on example script..
Type: crash Stage: resolved
Components: Tkinter Versions: Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: gpolo, loewis, serhiy.storchaka, terry.reedy, tmaslach
Priority: normal Keywords:

Created on 2012-06-30 04:25 by tmaslach, last changed 2015-04-07 09:25 by serhiy.storchaka. This issue is now closed.

Messages (3)
msg164367 - (view) Author: T. Maslach (tmaslach) Date: 2012-06-30 04:25
I've been running into a bug recently and reduced the code to the following:

import Tkinter                    
tk = Tkinter.Tk()
window = Tkinter.Frame(tk)
def onDestroy (event):
  pass
window.bind ("<Destroy>", onDestroy)


Just run and the following will be displayed: 
Fatal Python error: PyEval_RestoreThread: NULL tstate

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

If you add window.mainloop(), the issue goes aware.  However, I don't do that in my case.  window.update(), by the way, still causes the crash if that is of any interest (I found this tinkering)..

I'm running with:
 - Window 7
 - Python 2.7.2
 - 64-bit machine, but 32-bit Python

Thanks!
msg164748 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2012-07-06 19:46
On 3.3b0, Win7, 64-64 bit, run from IDLE, script brings up empty tk window. Closing it gives prompt back in Shell window.

Maslach, can you retry with 2.7.3 (bug fix is generally a good idea anyway) and maybe 64 bit version (you can install both 32 bit and 64 bit if you specify different directory -- I have done it.)
msg211096 - (view) Author: T. Maslach (tmaslach) Date: 2014-02-12 15:50
I just tried this in Python 2.7.6 and it works... So, it looks to be fixed!
History
Date User Action Args
2015-04-07 09:25:20serhiy.storchakasetstatus: open -> closed
resolution: out of date
stage: resolved
2014-02-12 15:50:18tmaslachsetmessages: + msg211096
2014-02-11 14:57:21pitrousetstatus: pending -> open
nosy: + serhiy.storchaka
2014-02-10 07:51:04serhiy.storchakasetstatus: open -> pending
2012-07-06 19:46:53terry.reedysetnosy: + terry.reedy
messages: + msg164748
2012-06-30 12:34:03pitrousetnosy: + loewis, gpolo
2012-06-30 04:25:56tmaslachcreate