Debugging a Python Program that Hangs

Ross Ridge rridge at
Wed Dec 3 21:21:20 CET 2008

Kevin D. Smith  <Kevin.Smith at> wrote:
>I have a fairly large python program that, when a certain combination 
>of options is used, hangs.  I have no idea where it is hanging, so 
>simply putting in print statements to locate the spot would be quite 
>difficult.  Unfortunately, ctrl-C'ing the program doesn't print a 
>traceback either. 

Have you tried catching the KeyboardInterrupt exception and printing
an exception?  Something like:

	except KeyboardInterrupt:

				Ross Ridge

 l/  //	  Ross Ridge -- The Great HTMU
[oo][oo]  rridge at
 db  //	  

More information about the Python-list mailing list