Udo Eberhardt added the comment:
Meanwhile I realized this problem as well. There is no easy solution to
determine exact spelling of the entire path. So it seems there is no simple
solution to my problem. The concept of treating file system paths
case-insensitive (as Windows does) seems to be
Udo Eberhardt added the comment:
So this is a trade-off between consistent behavior and efficiency. My point of
view is that glob is for enumerating matching files and it should consistently
return the real file names. Typically glob will be called with a pattern like
'*.txt' and it
New submission from Udo Eberhardt:
On Windows Path.glob does not always return the file name with correct case.
If the current directory contains a file named MixedCase.txt then the following
script:
import pathlib
p = pathlib.Path('.')
print(list(p.glob('*.txt')