[issue2953] _zip_directory_cache untested and undocumented

Maciek Fijalkowski report at bugs.python.org
Mon Apr 6 02:59:02 CEST 2009


Maciek Fijalkowski <fijal at genesilico.pl> added the comment:

setuptools at least deletes stuff from _zip_directory_cache (via _uncache
function in easy_install.py). it also iterates over it and checks for
existance of elements.

What about documenting details about _zip_directory_cache:
* does it need to be a normal python dictionary or anything?
* what methods it needs to support?
* what api zipimporter exposes?

Right now the situation is:
if I want my library not to be cached any more, I need to grab object
called _zip_directory_cache, and remove things from it. That's a very
non-obvious API for caching. Is it documented in some PEP?

The way I stomped on it - just passing the tests of zipimporter module
actually does not guarantee that you've implemented it correctly. You
also need to expose at least _zip_directory_cache otherwise setuptools
won't be too happy.

Stdlib is not only about testing cpython, it's also about what you
define as python these days.

I propose to have a clean api on zipimporter how to invalidate it's
caches. Maybe a general mechanism for that, I don't know.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2953>
_______________________________________


More information about the Python-bugs-list mailing list