diff --git a/socorro/signature/rules.py b/socorro/signature/rules.py index fadd2a9904..007e23fe4f 100644 --- a/socorro/signature/rules.py +++ b/socorro/signature/rules.py @@ -151,8 +151,6 @@ def normalize_cpp_function(self, function, line): if function.endswith(ref): function = function[: -len(ref)].strip() - # Convert `anonymous namespace' to (anonymous namespace) - # Drop the prefix and return type if there is any if it's not operator # overloading--operator overloading syntax doesn't have the things # we're dropping here and can look curious, so don't try @@ -247,6 +245,9 @@ def normalize_frame( # If there's a module, use that if module: + # Remove extra [ and/or ] at beginning or end if present; see Bug 1926077 + module = module.strip("[]") + return module # If there are unloaded modules, use the first one diff --git a/socorro/signature/tests/test_rules.py b/socorro/signature/tests/test_rules.py index 2a3a39c5d5..9a48175534 100644 --- a/socorro/signature/tests/test_rules.py +++ b/socorro/signature/tests/test_rules.py @@ -295,6 +295,11 @@ def test_no_mutation(self): ), "(unloaded unmod)", ), + # no function or line, so uses module; module name has extra bracket(s) + (("module]", "", "\\a\\b\\c\\source", "", "0xfff"), "module"), + (("[module]", "", "\\a\\b\\c\\source", "", "0xfff"), "module"), + (("[module", "", "\\a\\b\\c\\source", "", "0xfff"), "module"), + (("[[[module]]", "", "\\a\\b\\c\\source", "", "0xfff"), "module"), ], ) def test_normalize_frame(self, args, expected):