[issue4265] shutil.copyfile() leaks file descriptors when disk fills

2010-05-05 Thread Ammon Riley
Ammon Riley added the comment: You can replace the built-in open(), with one of your own devising: >>> import shutil >>> def open(*a, **k): ... raise IOError("faked error.") ... >>> __builtins__.open = open >>> shuti

[issue4265] shutil.copyfile() leaks file descriptors when disk fills

2008-11-05 Thread Ammon Riley
New submission from Ammon Riley <[EMAIL PROTECTED]>: If the disk fills up during the copy operation, shutil.copyfile() leaks file descriptors. The problem is the order of the close() statements in the finally block. In the event the copy operation runs out of disk space, the fdst.close(