Application Crashing

Robert Rawlins - Think Blue robert.rawlins at thinkbluemedia.co.uk
Fri Jun 29 10:27:47 EDT 2007


Hello Guys,

 

I find my application is freezing/crashing every now and then and it
becoming a bit of a frustration, so this morning I sat down to try and
locate the problem. After doing some debugging I think I've found the line
of code that causes my problem.

 

Print 'Read Results'

New = e.read()

Print 'Results Read'

 

The last thing the application does is print the words 'Read Results' which
leads me to think that the troublesome line is e.read(). This line is
reading the contents of a file object created by a popen command. This runs
without fail most of the time, but on a reasonably regular occurrence it
seems to crash my app.

 

I've tried wrapping it in a try/except, which I don't know much about and
that doesn't appear to make any difference, the app still crashes.

 

              print 'Reading Push'

              

              try:

                     new = e.read()

              except:

                     new = 'fault'

 

Print 'Results Read'

 

I'm not sure if this makes any difference, but this is all being run from
within a thread.

 

I need some help on handling this a little better to avoid my application
from dying on me, if anyone can offer some advice on what can be done it
would be greatly appreciated, I'm hoping just a small code solution will be
available.

 

Thanks guys, I look forward to hearing from you,

 

Rob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070629/647771a0/attachment.html>


More information about the Python-list mailing list