diff options
author | PJ Eby <distutils-sig@python.org> | 2006-03-24 17:49:02 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2006-03-24 17:49:02 +0000 |
commit | bbaeb0caa86dfc47871f28a21141bbc77ebf36d2 (patch) | |
tree | 0ea61578fefaa26878220822c791c46c3662310f /setuptools/command/easy_install.py | |
parent | 874bb1e0edb998be14cc504a3186be2636099d8e (diff) | |
download | external_python_setuptools-bbaeb0caa86dfc47871f28a21141bbc77ebf36d2.tar.gz external_python_setuptools-bbaeb0caa86dfc47871f28a21141bbc77ebf36d2.tar.bz2 external_python_setuptools-bbaeb0caa86dfc47871f28a21141bbc77ebf36d2.zip |
Fix ZipImportError when overwriting a zipfile with the same name/version
but different contents.
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4043297
Diffstat (limited to 'setuptools/command/easy_install.py')
-rwxr-xr-x | setuptools/command/easy_install.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 43afe313..6852ac6e 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -674,7 +674,7 @@ Please make the appropriate changes for your system and try again. dir_util.remove_tree(destination, dry_run=self.dry_run) elif os.path.exists(destination): self.execute(os.unlink,(destination,),"Removing "+destination) - + uncache_zipdir(destination) if os.path.isdir(egg_path): if egg_path.startswith(tmpdir): f,m = shutil.move, "Moving" @@ -1420,19 +1420,19 @@ def auto_chmod(func, arg, exc): raise exc[0], (exc[1][0], exc[1][1] + (" %s %s" % (func,arg))) +def uncache_zipdir(path): + """Ensure that the zip directory cache doesn't have stale info for path""" + from zipimport import _zip_directory_cache as zdc + if path in zdc: + del zdc[path] + else: + path = normalize_path(path) + for p in zdc: + if normalize_path(p)==path: + del zdc[p] + return - - - - - - - - - - - - + def get_script_args(dist, executable=sys_executable): """Yield write_script() argument tuples for a distribution's entrypoints""" spec = str(dist.as_requirement()) |