Skip to content

Commit e2c3a3b

Browse files
committed
Normalise path letters on Windows
paths on windows are not case-sensitive, and we're not really good about equivalent paths with differing case. However, it would be nice to believe that normpath() deals with that. Which, of course, it doesn't. For the most part though it works, with the frustrating exception of drive letters. So we hack it to normalise drive letters to uppercase, which prevents duplicate paths appearing in the breakpoints lists. Fixes #898
1 parent 696c52a commit e2c3a3b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python3/vimspector/core_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,8 @@ def override( target_dict: typing.MutableMapping,
9999

100100
def NormalizePath( filepath ):
101101
absolute_path = os.path.abspath( filepath )
102+
# Normalise windows drive letters to uppercase
103+
drive, tail = os.path.splitdrive( absolute_path )
104+
if drive:
105+
absolute_path = drive.upper() + tail
102106
return absolute_path if os.path.isfile( absolute_path ) else filepath

0 commit comments

Comments
 (0)