[python-win32] lingering open filehandle?

Andrew Hammond andrew.george.hammond at gmail.com
Thu Feb 9 02:17:11 CET 2012


We're using pycurl to download a file. The file is written to disk in the
context of a with statement. Once the file is written, we exit the context
and then do an os.rename() to move the downloaded file to it's final
destination. Immediately before doing the rename, I confirm that the
filehandle is closed. However, it appears that there is some lag between
when it says the filehandle is close and when it actually gets closed
because I often get a "[Error 32] The process cannot access the file
because it is being used by another process" exception raised on the rename
operation. Is this a known issue? Running python 2.6 on win32.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20120208/3ca2d6ba/attachment.html>


More information about the python-win32 mailing list