I\'m writing a script which will have to work on directories which are modified by hand by Windows and Linux users alike. The Windows users tend to not care at all about cas
Use case-insensitive regexes instead of glob patterns. fnmatch.translate generates a regex from a glob pattern, so
re.compile(fnmatch.translate(pattern), re.IGNORECASE)
gives you a case-insensitive version of a glob pattern as a compiled RE.
Keep in mind that, if the filesystem is hosted by a Linux box on a Unix-like filesystem, users will be able to create files foo, Foo and FOO in the same directory.