This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gregory.p.smith
Recipients brett.cannon, eric.snow, gregory.p.smith, python-dev, serhiy.storchaka, stutzbach
Date 2014-01-22.09:12:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1390381927.48.0.0909700246276.issue19081@psf.upfronthosting.co.za>
In-reply-to
Content
The problem appears to be that every zipimporter instance keeps its own reference to the zip files table of contents (self->files) instead of continually using the module wide zip_directory_cache but the zip_stat_cache is being maintained externally to that in a module wide fashion.

"import foo.bar" causes an "import foo" followed by an "import foo.bar" which uses a different zipimporter instance.  if it already exists, it's own self->files reference will be out of date despite the module global zip_stat_cache having been updated to say the TOC has been reread.

One solution to this would be to get rid of struct _zipimporter.files entirely and always use zip_directory_cache[self->archive] as the canonical single source for that.

"pro-tip" for anyone working on Python importers: You don't know how import works. Multiple instances of your importers will exist. If you think you know how import works, see the first statement again.
History
Date User Action Args
2014-01-22 09:12:07gregory.p.smithsetrecipients: + gregory.p.smith, brett.cannon, stutzbach, python-dev, eric.snow, serhiy.storchaka
2014-01-22 09:12:07gregory.p.smithsetmessageid: <1390381927.48.0.0909700246276.issue19081@psf.upfronthosting.co.za>
2014-01-22 09:12:07gregory.p.smithlinkissue19081 messages
2014-01-22 09:12:07gregory.p.smithcreate