• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SpamScope / mail-parser / 30493056703

29 Jul 2026 09:37PM UTC coverage: 99.778% (+0.002%) from 99.776%
30493056703

push

github

web-flow
fix: feature-detect getaddresses(strict=) so address parsing works on Python < 3.13 (#161)

* fix(get_addresses): feature-detect getaddresses(strict=) for Python < 3.13

email.utils.getaddresses only gained the ``strict`` keyword in Python 3.13
(backported to later 3.9-3.12 security patch releases). mail-parser targets
``requires-python >=3.9,<3.15``, so on an earlier patch release (e.g. CPython
3.11.3) get_addresses raised:

    TypeError: getaddresses() got an unexpected keyword argument 'strict'

which made downstream callers (e.g. parsedmarc) treat valid messages as
invalid. Detect whether ``strict`` is supported via inspect.signature and only
pass it when available, falling back to the default call otherwise.

Adds a regression test that simulates a pre-3.13 getaddresses and asserts the
address is parsed instead of crashing.

* fix(get_addresses): implement feature detection for strict parsing in getaddresses

---------

Co-authored-by: Fedele Mantuano <mantuano.fedele@gmail.com>

122 of 122 branches covered (100.0%)

2246 of 2251 relevant lines covered (99.78%)

1.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

99.63
/mailparser/utils.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc