[issue19718] Path.glob() on case-insensitive Posix filesystems

Ned Deily report at bugs.python.org
Fri Nov 22 22:18:15 CET 2013


Ned Deily added the comment:

FWIW, it looks like Path.glob() is behaving the same as the default shell (bash 3.2 on OS X 10.6.8):

Python 3.4.0a4+ (default:cce14bc9b675, Nov 22 2013, 13:01:47)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pathlib
>>> p = pathlib.Path(".")
>>> list(p.glob("fileA"))
[PosixPath('fileA')]
>>> list(p.glob("file*"))
[PosixPath('fileA')]
>>> list(p.glob("fileA*"))
[PosixPath('fileA')]
>>> list(p.glob("FILE*"))
[]
>>> list(p.glob("FILEa*"))
[]
>>> list(p.glob("FILEa"))
[PosixPath('FILEa')]
>>> list(p.glob("FILEA"))
[PosixPath('FILEA')]

$ ls .
fileA
$ ls fileA
fileA
$ ls file*
fileA
$ ls fileA*
fileA
$ ls FILE*
ls: FILE*: No such file or directory
$ ls FILEa*
ls: FILEa*: No such file or directory
$ ls FILEa
FILEa
$ ls FILEA
FILEA

----------

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


More information about the Python-bugs-list mailing list