From 31ab024a7defa7fbefe7c55164ad390f658b80bf Mon Sep 17 00:00:00 2001 From: Donald Stufft Date: Mon, 4 May 2015 07:47:21 -0400 Subject: [PATCH] Use shutil.move instead of os.rename os.rename causes errors to happen whenever the temporary location is on a different device than the wheel cache directory. Using shutil.move instead will cause it to use os.rename when it can and fallback to copying otherwise. --- pip/wheel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pip/wheel.py b/pip/wheel.py index 253d32171..a2e723927 100644 --- a/pip/wheel.py +++ b/pip/wheel.py @@ -641,7 +641,7 @@ class WheelBuilder(object): try: wheel_name = os.listdir(tempd)[0] wheel_path = os.path.join(output_dir, wheel_name) - os.rename(os.path.join(tempd, wheel_name), wheel_path) + shutil.move(os.path.join(tempd, wheel_name), wheel_path) logger.info('Stored in directory: %s', output_dir) return wheel_path except: