[issue26655] pathlib glob case sensitivity issue on Windows

Udo Eberhardt report at bugs.python.org
Mon Mar 28 09:24:02 EDT 2016


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')))
print(list(p.glob('Mixedcase.txt')))

yields:
[WindowsPath('MixedCase.txt')]
[WindowsPath('mixedcase.txt')]

Problem: The result of the second call to glob should be 'MixedCase.txt' as well. I would expect that glob returns a file name exactly as it is spelled in the file system.

----------
components: Library (Lib), Windows
messages: 262570
nosy: paul.moore, steve.dower, tim.golden, udo.eberhardt, zach.ware
priority: normal
severity: normal
status: open
title: pathlib glob case sensitivity issue on Windows
type: behavior
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26655>
_______________________________________


More information about the Python-bugs-list mailing list