thread/queue bug

Tim Peters tim.peters at
Mon Jan 3 00:29:30 EST 2005

[phillip.watts at]

Note that python-bugs-list is a moderated list for use only by
automated reports generated from SourceForge.  I'm redirecting the
reply to python-list at

> I have a very strange bug.  A thread in a .pyc stops dead.
> This program has many threads and queues and has worked
> great for months.
> One thread listens for UDP messages from other programs,
> and puts the messages in listenq.
> Procmsgs gets from listenq and for a certain kind of
> message creates another mq = Queue(0).
> I don't wish to distribute the source to
> so I have a short program import it, that is
> pnetx.pyc.
> Then the procmsgs thread dies at the Queue statement.
> But if I run as the main program, all works fine.
> So if or .pyc is imported this thread dies. ???
> I've tried this with 2.3.3 and 2.3.4.  Anyone?

Sounds like your module spawns a thread as a side effect of being
imported.  Don't do that -- you'll get in deadlock trouble with "the
import lock" if you do (use Google to learn more about that).

More information about the Python-list mailing list