(original) (raw)
So with importlib going in, should we do something with zipimport as well? Its deficiencies can easily be fixed by reimpementing it in Python instead -- the zipfile module has long since fixed the same 32k/2Gb issues (reading signed instead of unsigned numbers) and actually supports zip64 extensions (to break the 64k-filecount and 4Gb-filesize limits in "normal" zipfiles.) Actually supporting zipping the stdlib then becomes a bit harder: the importlib bootstrapping would need to include the zipfile module. If we do that, it would be nice to actually support zipping the stdlib in the Python build: making a build target that actually does that, and runs the tests with it. However, this requires modification of a whole bunch of tests, for example ones that assume that stdlib modules (and the tests themselves!) have actual files you can open() as their \_\_file\_\_ attribute, and we'd need to run the testsuite with the stdlib as a zip to prevent new ones from sneaking in. Also, at that point the question becomes if we need a transparent interface for opening module sourcefiles or arbitrary files living in packages, that could grab things out of zipfiles (like setuptools has in... one of the modules) -- or other archives of course.
(And, yes, I'm zipping up the stdlib for Python 2.7 at Google, to reduce the impact on the aforementioned million of machines :)
--
Thomas Wouters <thomas@python.org>
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
Thomas Wouters <thomas@python.org>
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!