fix: ContextualLogger crashes when callers pass exc_info=True #14
No reviewers
Labels
No Label
ai-changes-requested
ai-pr-opened
ai-reviewed
ai-reviewing
ai-working
in-next-release
status/in-progress
status/pr-open
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-v2#14
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/contextual-logger-exc-info"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
**kwargsasextra={}to Python's standard logger. When callers passedexc_info=True, it landed in the extra dict and Python's LogRecord raisedKeyError("Attempt to overwrite 'exc_info' in LogRecord")sinceexc_infois a reserved attribute./submit-scorecardto crash after game data was already posted, masking the original error and preventing proper rollback. Two users were affected today._extract_logging_params()to safely popexc_infoandstack_infofrom kwargs before passing asextra, forwarding them as proper logging parameters instead. Fixes ~25 call sites across the codebase.Test plan
/submit-scorecardlogs for proper error capture🤖 Generated with Claude Code
ContextualLogger methods forwarded all **kwargs as extra={} to Python's standard logger. When callers passed exc_info=True, it landed in the extra dict and Python's LogRecord raised KeyError("Attempt to overwrite 'exc_info' in LogRecord") since exc_info is a reserved attribute. This caused /submit-scorecard to crash after game data was already posted, masking the original error and preventing proper rollback. Fix: Extract exc_info and stack_info from kwargs before passing as extra, forwarding them as proper logging parameters instead. Also fix direct callers in submit_scorecard.py and views/players.py to use error=e. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>