path icon indicating copy to clipboard operation
path copied to clipboard

Windows paths shouldn't be canonicalized to lower-case

Open nex3 opened this issue 4 years ago • 2 comments

Although most paths on Windows are case-insensitive, it's possible to set certain directories as case-sensitive. This means that canonicalize() as currently implemented—converting all Windows paths to lower case—can cause a valid path to become invalid. It should probably instead match the behavior of other filesystems (including Mac OS which is also sometimes case-sensitive) and leave the case as-is.

Note that this means that, in general, paths cannot be truly canonicalized (in the sense of "guaranteeing that two paths that refer to the same location on disk will have the same string") without actually interacting with the filesystem on Windows (or Mac OS). This should probably be called out in the documentation.

nex3 avatar Dec 23 '20 23:12 nex3

See https://github.com/sass/dart-sass/issues/1169 where we hit this in practice.

nex3 avatar Dec 23 '20 23:12 nex3

Have the same problem

shuax avatar Jan 26 '24 06:01 shuax