id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,branch,changelog,apichanges,internalchanges 11528,Should not use fnmatch which is case-insensitive and platform dependent,Jun Omae,Jun Omae,"Trac core uses `fnmatch.fnmatch` method. The method internally use `os.path.normcase` and is depended on platform. I don't think we should use the methods for wildcard-globbing. We should use `fnmatch.translate` instead. Windows: {{{#!pycon Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] on win32 Type ""help"", ""copyright"", ""credits"" or ""license"" for more information. >>> from fnmatch import fnmatch >>> fnmatch('abc/def', r'a*/def') True >>> fnmatch('abc/def', r'a*\def') True >>> fnmatch('abc/def', r'a*\DEF') True }}} Linux: {{{#!pycon Python 2.4.3 (#1, Jan 9 2013, 06:49:54) [GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2 Type ""help"", ""copyright"", ""credits"" or ""license"" for more information. >>> from fnmatch import fnmatch >>> fnmatch('abc/def', 'a*/def') True >>> fnmatch('abc/def', r'a*\def') False }}} {{{ $ grep -wr --include='*.py' fnmatch trac tracopt trac/versioncontrol/web_ui/browser.py:from fnmatch import fnmatchcase trac/wiki/macros.py:from fnmatch import fnmatchcase trac/web/main.py:import fnmatch trac/web/main.py: and not any(fnmatch.fnmatch(path[:-1], pattern) tracopt/perm/authz_policy.py:from fnmatch import fnmatch tracopt/perm/authz_policy.py: if fnmatch(resource_key, resource_glob): }}}",defect,closed,normal,1.0.2,general,,normal,fixed,authzpolicy windows,Ryan J Ollos,,Case-sensitive matching resource names in authz policy on Windows.,,