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

Antoine Pitrou report at bugs.python.org
Fri Nov 22 18:49:42 CET 2013


New submission from Antoine Pitrou:

test_glob fails under OS X:

======================================================================
FAIL: test_glob (test.test_pathlib.PosixPathTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/test_pathlib.py", line 1615, in test_glob
    self.assertEqual(set(p.glob("FILEa")), set())
AssertionError: Items in the first set but not the second:
PosixPath('/Users/buildbot/buildarea/3.x.murray-snowleopard/build/build/test_python_39872/@test_39872_tmp/FILEa')


In that test, "FILEa" doesn't exist but "fileA" does.  glob() uses a shortcut when there's no wildcard: it calls .exists() instead of checking the name is inside listdir().  Unfortunately here, the filesystem is insensitive and Path("FILEa").exists() will return True.

However, p.glob("FILEa*") will really return nothing (at least I think so, I don't have a Mac to test), so this is a bit inconsistent.


If we decide the inconsistency is ok, I must then change the test to not exercise it :)

----------
components: Library (Lib), Tests
messages: 203820
nosy: hynek, ned.deily, pitrou, ronaldoussoren
priority: low
severity: normal
status: open
title: Path.glob() on case-insensitive Posix filesystems
type: behavior
versions: Python 3.4

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


More information about the Python-bugs-list mailing list