Commit a9c8dc5 1 parent 76b8651 commit a9c8dc5 Copy full SHA for a9c8dc5
File tree 2 files changed +6
-1
lines changed
src/pip/_internal/operations/install
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change
1
+ Fix normalizing path on Windows when installing package on another logical disk.
Original file line number Diff line number Diff line change @@ -262,7 +262,11 @@ def _record_to_fs_path(record_path):
262
262
def _fs_to_record_path (path , relative_to = None ):
263
263
# type: (text_type, Optional[text_type]) -> RecordPath
264
264
if relative_to is not None :
265
- path = os .path .relpath (path , relative_to )
265
+ # On Windows, do not handle relative paths if they belong to different
266
+ # logical disks
267
+ if os .path .splitdrive (path )[0 ].lower () == \
268
+ os .path .splitdrive (relative_to )[0 ].lower ():
269
+ path = os .path .relpath (path , relative_to )
266
270
path = path .replace (os .path .sep , '/' )
267
271
return cast ('RecordPath' , path )
268
272
You can’t perform that action at this time.
0 commit comments