Python 2.4/2.5 hang on bad reference?

Christian Convey conveycj at npt.nuwc.navy.mil
Thu Dec 28 12:25:02 EST 2006


Has anyone seen the following?

I've got a somewhat complicated program that includes pygtk, some C/C++ 
code, and lots of Python code.

My problem is that when some code tries to use a global variable that 
hasn't yet been created, or tries to invoke a method/function that 
doesn't exist in another module, the entire python program hangs. Ctrl-C 
doesn't kill it; I need to whack it from another terminal using the kill 
command.

Using print statements, it basically looks like execution of the Python 
interpreter simply hangs when it goes to the problem statement.

The code involved is straight, single-threaded Python code.  The code is 
running on the Gtk's event-handling thread.


I'm using a clean install of Ubuntu 6.10, and I see the same problem in 
both 2.4 and 2.5.

I've tried wrapping the offending code with a try/catch block, so that 
in case there's an exception it will get printed to stdout, but as far 
as I can tell my exception handler is never getting invoked.  (Perhaps 
I'm accidentally crafting my "except" statements too narrowly?)

Any ideas?

Thanks very much,
Christian

-- 
Christian Convey
Computer Scientist,
Naval Undersea Warfare Centers
Newport, RI
(401) 832-6824
conveycj at npt.nuwc.navy.mil



More information about the Python-list mailing list