By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,036 Members | 1,963 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,036 IT Pros & Developers. It's quick & easy.

Python 2.4/2.5 hang on bad reference?

P: n/a
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

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 Convey
Computer Scientist,
Naval Undersea Warfare Centers
Newport, RI
(401) 832-6824
Dec 28 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.