path
path copied to clipboard
Windows paths shouldn't be canonicalized to lower-case
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.
See https://github.com/sass/dart-sass/issues/1169 where we hit this in practice.
Have the same problem