no current thread warning

Charles Crain ccrain at austin.rr.com
Fri Dec 15 20:27:13 CET 2000


I, like many before me, and writing a python C module that wraps a library
that issues callbacks from a thread created from within C.  I have, of
necessity, become acquainted with all the
PyThreadState/PyEval_AcquireThread(), etc. stuff in order to do this without
crashing the interpreter.

However, I am disturbed by the following warning, which is issued whenever
one makes certain calls into the threading module from a callback within
python:

"currentThread(): no current thread for XXXX", where XXXX (I presume) is a
thread id.

Near as I can tell, this relates to the statement in the documentation for
the threading.currentThread() function, which states something to the effect
of "for threads not created by the threading module, a dummy thread with
limited capabilities will be created."

A have a couple questions regarding this:
1.  Exactly how are the capabilities limited?  Are there any gotchas I
should be on the lookout for?
2.  Why is the warning printed out unconditionally?  IMHO, it should only be
printed out if the error is potentially fatal, and/or amounts to an asserion
failure within the interpreter.  If I interpret the dox correctly, this
message could at best be considered an informational, and should therefore
be able to be turned off.  It is only cosmetic, but in considering whether
to commercially release products we have written in Python, it is an issue.

Thanks to anyone who can help,
Charles






More information about the Python-list mailing list