On 09.07.2010, at 09:16, Yao Yue wrote: > Naturally an error is raised. However the module does not release the > file object, and therefore the file is locked until caller exits. This might be helpful for you: http://www.mail-archive.com/image-sig@python.org/msg02822.html