Skip to content

Commit

Permalink
✅ Normalize path for case-insensitive string comparison on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
fbriol committed Sep 2, 2024
1 parent eb990f9 commit 7faa803
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zcollection/tests/test_fs_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ def istrcmp(str1, str2):
if platform.system() == 'Windows':
str1 = str1.replace('\\', '/')
str2 = str2.replace('\\', '/')
if str1.endswith(':'):
str1 += '/'
if str2.endswith(':'):
str2 += '/'
return str1.lower() == str2.lower()

assert istrcmp(fs_utils.normalize_path(fs, '/'), root)
Expand Down

0 comments on commit 7faa803

Please sign in to comment.