Skip to content

Commit d67dce9

Browse files
committed
Fix globbing on Windows
1 parent 74a43ab commit d67dce9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

newrelic/config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,11 +1194,11 @@ def _module_function_glob(module, object_path):
11941194
# Skip adding all class methods on failure
11951195
pass
11961196

1197-
# Under the hood uses fnmatch, which uses os.path.normcase
1198-
# On windows this would cause issues with case insensitivity,
1199-
# but on all other operating systems there should be no issues.
1200-
return fnmatch.filter(available_functions, object_path)
1201-
1197+
# Globbing must be done using fnmatch.fnmatchcase as
1198+
# fnmatch.filter and fnmatch.fnmatch use os.path.normcase
1199+
# which cause case insensitivity issues on Windows.
1200+
1201+
return [func for func in available_functions if fnmatch.fnmatchcase(func, object_path)]
12021202

12031203
# Setup wsgi application wrapper defined in configuration file.
12041204

0 commit comments

Comments
 (0)