Normalize case before comparing (#4770)

This commit is contained in:
Pradyun Gedam 2017-10-07 17:45:06 +05:30 committed by Paul Moore
parent d8e6654f8d
commit c81e8ac105
2 changed files with 4 additions and 4 deletions

View File

@ -128,7 +128,7 @@ def compress_for_output_listing(paths):
if fname.endswith(".pyc"):
continue
file_ = os.path.join(dirpath, fname)
file_ = os.path.normcase(os.path.join(dirpath, fname))
if os.path.isfile(file_) and file_ not in files:
# We are skipping this file. Add it to the set.
will_skip.add(file_)

View File

@ -48,9 +48,9 @@ def test_compressed_listing(tmpdir):
def in_tmpdir(paths):
li = []
for path in paths:
li.append(
str(os.path.join(tmpdir, path.replace("/", os.path.sep)))
)
li.append(str(os.path.normcase(
os.path.join(tmpdir, path.replace("/", os.path.sep))
)))
return li
sample = in_tmpdir([