match_regex_list raises IndexError when a pattern list contains an empty string
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
Research direction
Start at sentry_sdk.utils.match_regex_list and trace its use from CeleryIntegration.exclude_beat_tasks. Reproduce the empty-string case with the example in the issue, then verify that an empty pattern is handled without raising IndexError while existing matching behavior remains intact.
Written by the indexing model from the issue text.
Description
sentry_sdk.utils.match_regex_list iterates a user-supplied list of patterns and, with the default substring_matching=False, checks item_matcher[-1] != "$". If any element is the empty string, ""[-1] raises IndexError: string index out of range.
from sentry_sdk.utils import match_regex_list
match_regex_list("anything", [""])
This is reachable from the Celery integration (CeleryIntegration.exclude_beat_tasks is passed to match_regex_list with the default mode), so an empty string in that user-configured list crashes instead of being handled.
- Dominant language
- Python
- Stars
- 2.2k
- Forks
- 672
- Avg merge
- 1d 13m
- Merged PRs (30d)
- 212
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from getsentry/sentry-python
-
Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
getsentry/sentry-python#7543 · 1 comment ·
-
Python
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getsentry/sentry-python#6992 · 1 comment ·
-
Improvement Python
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
getsentry/sentry-python#6970 · 1 comment ·
-
Improvement Python Spans
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
getsentry/sentry-python#5833 · 1 comment ·
-
Improvement Python Spans
Difficulty 1/5 Under an hour Newbie friendliness 84/100
getsentry/sentry-python#5832 · 1 comment ·
All issues in getsentry/sentry-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100