[IronPython] IP1.1.2 - Exception Catching

Christian Muirhead christian.muirhead at resolversystems.com
Wed Jan 14 13:11:16 CET 2009

Davy Mitchell wrote:
> I am running a simple script to configure IIS using 
> System.DirectoryServices and it has been running well for months.
> The whole thing is wrapped in a try i.e.
> try:
>     ...
> except Exception, inst:
>     ... # write to log file.
> I've had a single execution (trying to reproduce) that caused the script 
> to stop mid-way thru but not record any exception. Now it could be the 
> logging failed somehow but I am wondering if 'except Exception, inst' is 
> a suitable catch all??

Just to add - we've seen this a few times as well. Our distributed build 
script very occasionally dies with an IronPython Console crash dialog 
despite try/excepts around all of the threads of execution. It took a 
long time to actually see what the error was - it looks like it was a 
.NET file system exception resulting from a call to shutil.copyfile 
(unfortunately I didn't manage to grab the text). The traceback was from 
<somestream>.Flush - we're copying files over a network which 
occasionally goes away, so that would make sense.

(This is also IP 1.1.2 - haven't tried this with IP 2.)


Christian Muirhead
Resolver Systems
christian.muirhead at resolversystems.com

Resolver Systems Ltd
17a Clerkenwell Road, London EC1M 5RD, UK
VAT No.: GB 893 5643 79 Registered in England and Wales as company 
number 5467329.
Registered address: 843 Finchley Road, London NW11 8NA, UK

More information about the Ironpython-users mailing list