Message208761
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. |
|
Date |
User |
Action |
Args |
2014-01-22 09:12:07 | gregory.p.smith | set | recipients:
+ gregory.p.smith, brett.cannon, stutzbach, python-dev, eric.snow, serhiy.storchaka |
2014-01-22 09:12:07 | gregory.p.smith | set | messageid: <1390381927.48.0.0909700246276.issue19081@psf.upfronthosting.co.za> |
2014-01-22 09:12:07 | gregory.p.smith | link | issue19081 messages |
2014-01-22 09:12:07 | gregory.p.smith | create | |
|