[New-bugs-announce] [issue42807] smtplib send_message should gives more clear exception if the msg is None

oon arfiandwi report at bugs.python.org
Fri Jan 1 23:23:16 EST 2021


New submission from oon arfiandwi <oon.arfiandwi at gmail.com>:

I want to enhance the error message on the send_message method of class SMTP, in module smtplib.

One of the parameters on send_message is msg which is email.message.Message object, this is a required argument. If the msg is None, currently it will raise "AttributeError: 'NoneType' object has no attribute 'get_all'".
This message is not straight forward and a bit hard to debug.

As the easy fix with additional check if msg is None in send_message method.

I want to add PR on this, also with the additional test(s). This is my first issue, appreciate any feedback. thank you.

----------
components: Library (Lib)
messages: 384216
nosy: oon
priority: normal
severity: normal
status: open
title: smtplib send_message should gives more clear exception if the msg is None
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42807>
_______________________________________


More information about the New-bugs-announce mailing list