Re: Exceptions when closing a file

2007-03-20 Thread Ben Finney
John Nagle <[EMAIL PROTECTED]> writes: > If you want to force [an error while closing a file], write to > a drive reached over a network, or a removable medium like a floppy > or flash card. Open a file for writing and disconnect the network > or remove the removable medium. Or simply use a

Re: Exceptions when closing a file

2007-03-20 Thread kyosohma
On Mar 20, 4:26 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] a écrit : > > > > > On Mar 20, 12:25 pm, Steven D'Aprano > > <[EMAIL PROTECTED]> wrote: > > >>Closing a file can (I believe) raise an exception. Is that documented > >>anywhere? I've spent a lot of frustrating ti

Re: Exceptions when closing a file

2007-03-20 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > On Mar 20, 12:25 pm, Steven D'Aprano > <[EMAIL PROTECTED]> wrote: > >>Closing a file can (I believe) raise an exception. Is that documented >>anywhere? I've spent a lot of frustrating time trying to track this down, >>with no luck, which suggests that either my google

Re: Exceptions when closing a file

2007-03-20 Thread John Nagle
Ross Ridge wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >>Closing a file can (I believe) raise an exception. Is that documented >>anywhere? > > > In a catch-all statement for file objects: "When a file operation fails > for an I/O-related reason, the exception IOError is raised." The

Re: Exceptions when closing a file

2007-03-20 Thread Ross Ridge
Steven D'Aprano <[EMAIL PROTECTED]> wrote: >Closing a file can (I believe) raise an exception. Is that documented >anywhere? In a catch-all statement for file objects: "When a file operation fails for an I/O-related reason, the exception IOError is raised." The fact that close() is a file opera

Re: Exceptions when closing a file

2007-03-20 Thread kyosohma
On Mar 20, 12:25 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > Closing a file can (I believe) raise an exception. Is that documented > anywhere? I've spent a lot of frustrating time trying to track this down, > with no luck, which suggests that either my google-foo is weak or that it > isn't doc

Exceptions when closing a file

2007-03-20 Thread Steven D'Aprano
Closing a file can (I believe) raise an exception. Is that documented anywhere? I've spent a lot of frustrating time trying to track this down, with no luck, which suggests that either my google-foo is weak or that it isn't documented. Is IOError the only exception it can raise? The only thing I h