Re: Debugging a Python Program that Hangs



check winpdb / rpdb2,
cheers,
Stef

On 12/3/08, alex23 <wuwei23@xxxxxxxxx> wrote:
On Dec 3, 2:19 am, Kevin D. Smith <Kevin.Sm...@xxxxxxx> 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. Looking through the python debugger documentation, I
don't see how to run a python program and interactively stopping it
while it is running. Is there a way to stop within a running python
program to see where it is getting hung up?

Hey Kevin, long time fan of your films! (I bet you get that a lot...)

The trace module might help you identify where it's getting caught up:

http://www.python.org/doc/2.5.2/lib/trace-cli.html

--
http://mail.python.org/mailman/listinfo/python-list

.



Relevant Pages

  • Re: Debugging a Python Program that Hangs
    ... simply putting in print statements to locate the spot would be quite ... don't see how to run a python program and interactively stopping it ...  Is there a way to stop within a running python ...
    (comp.lang.python)
  • Re: Debugging a Python Program that Hangs
    ... simply putting in print statements to locate the spot would be quite ... don't see how to run a python program and interactively stopping it ...  Is there a way to stop within a running python ...
    (comp.lang.python)
  • Re: LWP hangs
    ... in a sub or another package or a variety of ways.. ... as easy to copy the whole thing over and pollute with print statements) ... have found exactly where it's hanging, and, if you're lucky.. ... kill the process - only Task Manager kill. ...
    (comp.lang.perl.misc)
  • Re: LWP hangs
    ... When you say you override the method - how exactly is it done? ... in a sub or another package or a variety of ways.. ... as easy to copy the whole thing over and pollute with print statements) ... have found exactly where it's hanging, and, if you're lucky.. ...
    (comp.lang.perl.misc)
  • Re: I see advice on how to debug a python module that hangs up the process
    ... >> The first step I'd suggest is to sprinkle print statements all around ... >> later perusal) and see when the thing hangs. ... You could also run python with -u so you're sure to get all the output flushed immediately, ... >>> def ptrace: ...
    (comp.lang.python)