Repository navigation
fix(ext.smtp): unnamed attachments and encoded X-headers - #824
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
edb0b2c to
73e5a19
Compare
Summary
Fixes two
TypeErrors inext.smtpreported by @TomFreudenberg.{'path': ..., 'cid': ...}or(None, path)) crashed becauseos.path.basename()was called onNone. The basename is now applied only when a name is given; otherwise the name falls back to the basename ofpathas intended. The existing basename-on-explicit-name behaviour is unchanged (opt-out tracked in ext.smtp: opt-in setting to keep explicit attachment names as given #823).header_encodingwas set, becausemsg.add_header()can't take anemail.header.Header. They are now assigned likeSubject(msg[item] = ...), which has the same append semantics.Test cleanup: the PNG fixture code repeated in three tests is now a
_make_png()helper.Follow-ups: #821 (quote
Content-Dispositionfilename), #822 (re-enable X-header assertion), #823 (opt-infiles_basename).Test plan
(None, path)tuple, dict withcidand nonametests/ext/test_ext_smtp.py: 28 passed,ext_smtp.pyat 100% coveragemake comply(ruff + mypy) cleanCloses #819
Closes #820
🤖 Generated with Claude Code
Summary by CodeRabbit