On 5/30/25 07:33, Thomas Ward via Mailman-Developers wrote:
Aha, you were correct!  It's returning an `email.header.Header` datatype, but it's also doing this for `msg.get('Subject', '(No Subject)')` which looks like aberrant behavior since the same for `msg['To']` returns a string!

I may have to raise that as a bug with Python!  (Either that or Python on the mailman system is just old enough that that was fixed later... Python 3.10)

Whether `msg.get('header_name', 'default')` returns a string or an email.header.Header object depends on the raw value and how it is parsed into a msg object. It does not depend on the header_name.

In either case `str(msg.get('header_name', 'default'))` will return the appropriate string.

--
Mark Sapiro <m...@msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

_______________________________________________
Mailman-Developers mailing list -- mailman-developers@python.org
To unsubscribe send an email to mailman-developers-le...@python.org
https://mail.python.org/mailman3/lists/mailman-developers.python.org/
Mailman FAQ: https://wiki.list.org/x/AgA3

Security Policy: https://wiki.list.org/x/QIA9

Reply via email to