From 7faa803e837c4faf2d09988276ccb5405174370d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20BRIOL?= Date: Mon, 2 Sep 2024 11:03:13 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Normalize=20path=20for=20case-insen?= =?UTF-8?q?sitive=20string=20comparison=20on=20Windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zcollection/tests/test_fs_utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zcollection/tests/test_fs_utils.py b/zcollection/tests/test_fs_utils.py index 409a82c..9fca517 100644 --- a/zcollection/tests/test_fs_utils.py +++ b/zcollection/tests/test_fs_utils.py @@ -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)