Message4109
During the construction of a ZipFile object, a
file is opened and assigned to self.fp.
If anything goes wrong, i.e. the file is not a zipfile,
it is not closed explicitly.
On Windows, this does not work:
import zipfile, os
filename="test.zip" # it's a broken one
try:
zf=zipfile.ZipFile(filename)
zf.close()
finally:
os.unlink(zipfile)
=> OSError: [errno 13] Permission denied "test.zip"
(on Unix, the file stays open too, but unlink doesn't
fail)
|
|
Date |
User |
Action |
Args |
2007-08-23 13:53:45 | admin | link | issue412214 messages |
2007-08-23 13:53:45 | admin | create | |
|