Title: Add import fix for email.Message
Type: behavior Stage: resolved
Components: 2to3 (2.x to 3.x conversion tool) Versions: Python 3.10, Python 3.9
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: barry, benjamin.peterson, iritkatriel, kitterma, r.david.murray
Priority: normal Keywords: patch

Created on 2011-03-06 16:29 by kitterma, last changed 2020-10-19 23:16 by barry. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 22313 closed iritkatriel, 2020-09-18 18:12
Messages (8)
msg130179 - (view) Author: Scott Kitterman (kitterma) Date: 2011-03-06 16:29
email.Message was dropped in python3.

from email.Message import Message

now fails.  Changing email.Message to email.message seems to be all that's needed.
msg130200 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2011-03-06 23:26
Note that email.message works (and is the preferred spelling) since Python2.5.
msg130216 - (view) Author: Scott Kitterman (kitterma) Date: 2011-03-07 01:02
Agreed, but email.Message was never marked deprecated so there's likely old code out there that's never been updated (which is how I ran into this).  This would be, I think, a very low risk transformation to apply.
msg130262 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2011-03-07 17:03
msg377130 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-09-18 17:43
It this still relevant? Presumably anyone who was going to be broken has been broken by now and moved to lower case message.
msg377131 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-09-18 17:44
Ah sorry this is about adding a 2to3 fixer. I thought the request was to put Message back in __all__. 

A fixer may still be relevant.
msg377664 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-09-29 12:10
I've added a PR with this fixer, which is quite a simple addition because the mechanism for such renames is already there.

If we don't want to add features to lib2to3 (since I understand it will be deprecated in the future), then shall we instead close this issue as won't-do?
msg379058 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2020-10-19 23:16
Thanks for the PR @iritkatriel but I'm inclined to close this as won't fix.  There are plenty of other changes someone would need to migrate to Python 3 for the email package, so I think this is of limited benefit.
Date User Action Args
2020-10-19 23:16:18barrysetstatus: open -> closed
resolution: wont fix
messages: + msg379058

stage: patch review -> resolved
2020-09-29 12:10:51iritkatrielsetmessages: + msg377664
2020-09-18 18:13:10iritkatrielsettype: behavior
versions: + Python 3.9, Python 3.10
2020-09-18 18:12:44iritkatrielsetkeywords: + patch
stage: patch review
pull_requests: + pull_request21359
2020-09-18 17:44:24iritkatrielsetmessages: + msg377131
2020-09-18 17:43:08iritkatrielsetnosy: + iritkatriel
messages: + msg377130
2011-03-07 17:03:21barrysetnosy: + barry
messages: + msg130262
2011-03-07 01:02:19kittermasetnosy: benjamin.peterson, r.david.murray, kitterma
messages: + msg130216
2011-03-06 23:26:46r.david.murraysetnosy: + r.david.murray, benjamin.peterson
messages: + msg130200
2011-03-06 16:29:22kittermacreate