Re: [Distutils] occasional zipimport.ZipImportError: bad local file header

At 06:43 PM 2/5/2009 +0000, Fadhley Salim wrote:
I'm working on an automatic testing framework which installs eggs downloaded directly from the web-server. From time to time I get a very long stacktrace leading to a ZipImportError (see the pastebin link). Leading up to the error all I do is download the egg into the system's %TEMP% folder. I'm installing the egg like this:
easy_install.main( ['-zma', '-f' , config.INSTALL_TOOLS_EGG_VALIDHOSTS, filepath, ]
There is apparantly nothing wrong with the file - I can open it in Winzip. If I re-run the process it seems to work fine. The file in question appears to be identical. The error is rare, it seems to occur in about 1 out of 100 easy_install operations. Any suggestions what might be causing this?
Very long stacktrace on pastebin: http://python.pastebin.com/m378949f3
I am using setuptools==0.6c9 on Python 2.4 running on Windows XP
This might be due to: http://bugs.python.org/issue856103 Specifically, zipimport's caching doesn't notice that it's not working on the same zipfile any more. easy_install is supposed to have some code in it to clear out the zipimport cache, but there is some possibility that it could have two versions of the path in there on a case-insensitive filesystem (e.g. Windows), and only one of them is getting cleared. Dunno if that's the case or not, but it might be something to look into. You could always stick a debugging print in the uncache_zipdir function and see if there's any correlation between what it's doing and when you're getting the error.
participants (1)
-
P.J. Eby