]> granicus.if.org Git - python/commit
Issue #19081: Remove the zipimporter.files reference as the zip TOC
authorGregory P. Smith <greg@krypto.org>
Mon, 27 Jan 2014 08:15:10 +0000 (00:15 -0800)
committerGregory P. Smith <greg@krypto.org>
Mon, 27 Jan 2014 08:15:10 +0000 (00:15 -0800)
commit027ab390143d9f95c16db19bc66c00bebbb04a96
tree5b6833a0f47ea47ae81cf6897c6f5fdea4a4cb9b
parent1d9b9215f026ea36d10212a100bde7b91c90bf2e
Issue #19081: Remove the zipimporter.files reference as the zip TOC
caches are module global in the zip_directory_cache. When it is
updated due to a changed zip file, all zipimporter instances need to
see the same updates TOC cache.  This fixes the bug for the overlooked
submodule import case from the earlier round of changes.  Includes
tests that would fail otherwise.

It also refactors zipimporter_init in the process to make it a bit
easier to read and understand.  Less reuse of the same variable for
multiple purposes and the local path buffer is malloc'ed instead
of consuming a large MAXPATHLEN+2 chunk stack space.
Lib/test/test_zipimport.py
Modules/zipimport.c