import freeze

Colin Brown cbrown at metservice.com
Tue Nov 25 06:55:05 CET 2003


"Peter Hansen" <peter at engcorp.com> wrote in message
news:3FC2CF56.4312A00E at engcorp.com...
> Colin Brown wrote:
> >
> > I have a Pyro server thread that is not starting and I have traced the
> > problem through to the a point in the Pyro code where it freezes. The
code
> > fragment (my added print statements):
> >
> >    print '[finalizeConfig_Server] before import random'
> >    import random
> >    print '[finalizeConfig_Server] after import random'
> >
> > is printing the first print line but not the second. Is there any way of
> > dynamically turning on in-depth tracing before the import statement?
> > [Py2.3.2, Win2K]
>
> Not sure about tracing per se, but if you can run the server program
> without detaching from the console, the following two lines of code
> can be exceptionally helpful:
>
>  import pdb
>  pdb.set_trace()
>
> This lets you manually single-step through the code to find the source
> of the trouble (and other features, probably including some real
> tracing).
>
> -Peter

Thanks Peter

I have never really got into pdb, it has always seemed too clunky and is
difficult to use with multithreaded code. Somehow I think my time will be
better spent working through other avenues.

The crazy thing is all I have done is copied a working Pyro application to a
different directory and put the mainline code into the package. I wish to
run
the program via "exec('from PkgName import Main')" but it is all turning to
custard! All my other socket code, Pyro clients and threads are fine but the
server code just hangs. I am so close to encapsulating all the application
code
into a zip package, it is really frustrating to have to give up now but I
haved
reached an impasse.

Colin









More information about the Python-list mailing list