Comment 18 for bug 187106

Revision history for this message
Martin Packman (gz) wrote :

I see two possible ways forward.

1) Open and store the fd in zipimport_init, possibly with the share mode on windows as anything, including FILE_SHARE_DELETE. Close the fd in zipimporter_dealloc, and pass it down into read_directory and get_data functions. This could be proposed upstream, but persuading them to take it as a bug fix when it's a pretty large behaviour change may be hard.

2) See if keeping a handle open within the same process but outside the context of the zip importer is enough to stop the buggy scanners rechecking the archive every operation. That could then be a hacky fix in py2exe or even bzr, though again whether it's the sort of thing that should be enabled by default is another question.