Help with capturing error

Chris Rebert clp at
Fri Nov 28 00:22:10 CET 2008

On Thu, Nov 27, 2008 at 12:33 PM, tekion <tekion at> wrote:
> Hello,
> I am getting the following error and my script is bailing out because
> of it. I have tried capturing it but it does not seem to work.  Below
> is the error:
> ValueError: I/O operation on closed file
> the above error is received when, the following code snippet is
> executed:
>                try:
>    117          self.xml_file.close()
>    118       except ValueError:
>    119          print "file, %s is already closed" % self.seek_file
> Any idea why line 118, is not capturing the error? Thanks.

In order to help you debug an exception, generally a full Traceback is
If you post the full traceback, it will help people immensely in
helping determine the cause of your problem.

Follow the path of the Iguana...

> --

More information about the Python-list mailing list