Skip to content

Commit a0a9af2

Browse files
committed
Use syspath in case sensitivity check (#1586)
1 parent 4677903 commit a0a9af2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

beets/util/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -792,23 +792,23 @@ def case_sensitive(path):
792792
except Windows.
793793
"""
794794
# A fallback in case the path does not exist.
795-
if not os.path.exists(path):
795+
if not os.path.exists(syspath(path)):
796796
# By default, the case sensitivity depends on the platform.
797797
return platform.system() != 'Windows'
798798

799799
# If an upper-case version of the path exists but a lower-case
800800
# version does not, then the filesystem must be case-sensitive.
801801
# (Otherwise, we have more work to do.)
802-
if not (os.path.exists(path.lower()) and
803-
os.path.exists(path.upper())):
802+
if not (os.path.exists(syspath(path.lower())) and
803+
os.path.exists(syspath(path.upper()))):
804804
return True
805805

806806
# Both versions of the path exist on the file system. Check whether
807807
# they refer to different files by their inodes. Alas,
808808
# `os.path.samefile` is only available on Unix systems on Python 2.
809809
if platform.system() != 'Windows':
810-
return not os.path.samefile(path.lower(),
811-
path.upper())
810+
return not os.path.samefile(syspath(path.lower()),
811+
syspath(path.upper()))
812812

813813
# On Windows, we check whether the canonical, long filenames for the
814814
# files are the same.

0 commit comments

Comments
 (0)