[Python-bugs-list] [Bug #131207] Fatal Python Error during program shutdown

noreply@sourceforge.net noreply@sourceforge.net
Mon, 05 Feb 2001 18:50:41 -0800


Bug #131207, was updated on 2001-Feb-05 18:50
Here is a current snapshot of the bug.

Project: Python
Category: Tkinter
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Submitted by: djhender
Assigned to : nobody
Summary: Fatal Python Error during program shutdown

Details: The windows builds of versions 2.0 and 2.1a2 contain an
intermittent bug which often appears when a script using Tkinter stops by
calling self.tk.quit() and sometimes (less often) appears following a
<Destroy> event or call to a ?.destory() function.
Under Windows 98SE, this results in a GPF.
Under Windows 2000, a message to the console window shows "Fatal Python
Error", "PyEval_RestoreThread NULL tstate".

The following script demonstrates the problem:
---------------------
# BugDemo.py

from Tkinter import *

class BugDemo(Frame):
    def __init__(self, parent):
        Frame.__init__(self, parent)
        Button(self, text='Hi', command=self.hi).pack()
        Button(self, text='Quit', command=self.tk.quit).pack()
    def hi(self):
        print "hi"

bd = BugDemo(Tk())
bd.pack()
bd.mainloop()
----------------------
Execute in console window: "c:> python BugDemo.py"
Test this by 1) clicking Quit button 2) clicking Hi button, then Quit
button.
Test 1: The script runs successfully most of the time. I found I had to
minimize and restore its window to make it fail regularly.
Test 2: I need to click Hi button before clicking the Quit button. Then it
failed about half the time.

The problem appears to occur after the script has completed, during some
kind of cleanup perhaps. The more useful error message on the Win2k machine
may help to locate the problem.

Problem also manifests using the PythonWare 2.0 release on Win98.

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=131207&group_id=5470