Skip to content

Commit

Permalink
Normalise path letters on Windows
Browse files Browse the repository at this point in the history
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
  • Loading branch information
puremourning committed Dec 11, 2024
1 parent 696c52a commit e2c3a3b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python3/vimspector/core_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,8 @@ def override( target_dict: typing.MutableMapping,

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

0 comments on commit e2c3a3b

Please sign in to comment.