[Image-SIG] Image.open doesn't close file before raising IOError "cannot identify image file"
Wed, 26 Mar 2003 02:11:45 -0800
If Image.open raises an IOError ("cannot identify image file"), it doesn't close the file.
For my own use I've added
just before the error is thrown (Line 1507). Don't know if that's the best way, or if there might be any unforseen consequence. Seems to fix my specific problem; I am trying to delete the image immediately if it isn't identified:
im = Image.open(filename)
Everything else works great!