Comment 14 for bug 187106

Revision history for this message
Krzysztof Nowicki (krissn) wrote :

I'm experiencing this problem on my company laptop with Windows 7 and McAfee antivirus. According to my investigation the real problem lies in the zipinfo Python module and affects all programs using py2exe with the option to compress all python objects into a single ZIP archive (library.zip). The reason is that during startup of such an executable, py2exe uses the zipimport Python module to extract the imported modules from the ZIP file. Unfortunately the zipinfo module will open the ZIP file each time it needs to extract a module and close the file afterwards. In the Windows world with a resident antivirus software this means that the ZIP file will be scanned each time it is opened, i.e. each time one module is loaded. Smart antivirus scanners will scan the file only the first time and remember upon the next scan that it was clean. Apparently McAfee is not one of them (in contrary to what they claim).

In order to verify this I made an ugly hack in the zipinfo module - the file descriptor of the archive is reused every time instead of closing and opening it again. The result is a huge improvement in bzr startup time.