summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Smith <qwcode@gmail.com>2014-04-23 13:08:07 -0700
committerMarcus Smith <qwcode@gmail.com>2014-04-23 13:08:07 -0700
commit79408cbc6fa5d61b74b046105aee61f12311adc9 (patch)
tree7a0d30296ab14cd8e6637d4c4f7bdb1d048549f9
parentb542c9906bfb8f700291ca6e16e10b7971a89dcb (diff)
downloadpip-79408cbc6fa5d61b74b046105aee61f12311adc9.tar.gz
use copy2, not move, to ensure dirs are not copied
-rw-r--r--pip/wheel.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pip/wheel.py b/pip/wheel.py
index 82df2973f..4e9803f23 100644
--- a/pip/wheel.py
+++ b/pip/wheel.py
@@ -199,10 +199,14 @@ def move_wheel_files(name, req, wheeldir, user=False, home=None, root=None,
srcfile = os.path.join(dir, f)
destfile = os.path.join(dest, basedir, f)
# directory creation is lazy and after the file filtering above
- # to ensure we don't install empty dirs
+ # to ensure we don't install empty dirs; empty dirs can't be
+ # uninstalled.
if not os.path.exists(destdir):
os.makedirs(destdir)
- shutil.move(srcfile, destfile)
+ # use copy2 (not move) to be extra sure we're not moving
+ # directories over; copy2 fails for directories. this would
+ # fail tests (not during released/user execution)
+ shutil.copy2(srcfile, destfile)
changed = False
if fixer:
changed = fixer(destfile)