mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
use copy2, not move, to ensure dirs are not copied
This commit is contained in:
parent
b542c9906b
commit
79408cbc6f
1 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue