datatracker icon indicating copy to clipboard operation
datatracker copied to clipboard

Migrate from Message to EmailMessage for email handling

Open jennifer-richards opened this issue 4 months ago • 0 comments

Description

Datatracker's email handling is done in terms of the email.message.Message class, which is deprecated. We should migrate over to the similar email.message.EmailMessage class.

As noted in the email policy docs, the default policy for parser and other library utilities is to use the Compat32 policy, which guarantees backward compatibility with the Python 3.2 idea of representing messages. However, it notes

The default value for the policy keyword for the email.parser classes and the parser convenience functions will be changing in a future version of Python. Therefore you should always specify explicitly which policy you want to use when calling any of the classes and functions described in the parser module.

so we should probably make that explicit setting right away.

Code of Conduct

jennifer-richards avatar Oct 09 '24 19:10 jennifer-richards