Fatal Python error: PyThreadState_Get: no current thread

Timothy Docker timd at macquarie.com.au
Thu Apr 29 03:35:02 EDT 1999


I've seen questions related to this error in dejanews, but no
definitive answer. It seems that this error can indicate a variety of
misconfigurations. Here's my situation:

I have a program written a while ago under python 1.4 that I am trying
to run under python 1.5.1. This program uses Tkinter, and makes no
reference to Threads. On my Solaris 2.6 machine here I have

	python1.4	- compiled without threads
	python1.5.1	- compiled with threads
	python1.5.2	- compiled with threads

After a lot of reduction, I ended up with the 10 or so lines shown
below. If I run it each of the installed versions and press the
displayed quit button, I see the following

  |  qad16:tools $ /opt/python/python1.4/sunos5/bin/python test.py
  |  qad16:tools $ /opt/python/python1.5.1/bin/python test.py
  |  Fatal Python error: PyThreadState_Get: no current thread
  |  Abort
  |  qad16:tools $ /opt/python/python1.5.2/bin/python test.py
  |  qad16:tools $ 

So... what's wrong with my 1.5.1 installation? Have I misconfigured
the thread stuff, or is a bug that has been fixed in 1.5.2? There is a 
note in the Misc/NEWS of 1.5.2 that says that  PyThreadState_Get has
been replaced by a macro that doesn't do error checking. Does this
mean that the problem is still lurking in my 1.5.2 installation?

Thanks for any pointers!

Tim

-------------------- test.py --------------------
import sys
from Tkinter import *

def cancel():
    sys.exit(0)

def quitFromWM(event):
    pass

mf = Frame()
mf.bind("<Destroy>", quitFromWM )
f = Frame(mf).pack(side=BOTTOM,fill=BOTH)
Button( f, text = 'Quit', command = cancel ).pack()
mf.mainloop()




--------------------------------------------------------------
Tim Docker                               timd at macquarie.com.au
Quantative Applications Division
Macquarie Bank




More information about the Python-list mailing list