[issue2953] _zip_directory_cache untested and undocumented

Brett Cannon report at bugs.python.org
Mon Apr 6 06:03:46 CEST 2009


Brett Cannon <brett at python.org> added the comment:

Does distutils use _zip_directory_cache in any way? If not then setuptools
is in the wrong here for using a private attribute and it is on them to make
it work if the attribute does not exist, period.

Otherwise someone will need to come up with a very simple API or set or
rules to follow for clearing the cache and get setuptools to switch to it
(IMO it should be handled by simply deleting all entries for a module in
sys.modules, removing the path hook from sys.path_hooks, and then clear out
sys.path_importer_cache for all paths associated with the module). Be aware,
though, this is all leading down the road of special-casing zip imports when
you may very well run into the same issues if people start to develop other
importers -- e.g. tarball, dbm, or sqlite3 importers -- and this will all
start up again.

----------
Added file: http://bugs.python.org/file13625/unnamed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2953>
_______________________________________
-------------- next part --------------
Does distutils use _zip_directory_cache in any way? If not then setuptools is in the wrong here for using a private attribute and it is on them to make it work if the attribute does not exist, period.<br><br>Otherwise someone will need to come up with a very simple API or set or rules to follow for clearing the cache and get setuptools to switch to it (IMO it should be handled by simply deleting all entries for a module in sys.modules, removing the path hook from sys.path_hooks, and then clear out sys.path_importer_cache for all paths associated with the module). Be aware, though, this is all leading down the road of special-casing zip imports when you may very well run into the same issues if people start to develop other importers -- e.g. tarball, dbm, or sqlite3 importers -- and this will all start up again.<br>



More information about the Python-bugs-list mailing list