classification
Title: Generator._encoded_EMTPY misspelling in email package
Type: Stage: resolved
Components: email Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: r.david.murray Nosy List: barry, martin.panter, python-dev, r.david.murray
Priority: normal Keywords:

Created on 2016-07-27 01:07 by martin.panter, last changed 2016-09-09 02:30 by r.david.murray. This issue is now closed.

Messages (5)
msg271424 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-07-27 01:07
In the Generator.flatten() (Lib/email/generator.py), the code sets, among others, the instance attributes _EMPTY (correct spelling) and _encoded_EMTPY (misspelling). Further down in that class, _encoded_EMPTY (correct spelling) is set as a class attribute, and this correctly-spelt version appears to be used in the _handle_message_delivery_status() method. The BytesGenerator class inherits Generator and overrides the correctly-spelt _encoded_EMPTY class attribute.

It seems that both _EMPTY and the misspelt _encoded_EMTPY instance attributes are not used. Perhaps they should be removed. Or perhaps they are not doing the job they were intended for and there is a real bug.
msg271451 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-07-27 14:02
The former is kept (IIRC) for backward compatibility, the latter should be investigated.  Since I wrote that code I'll have to add this to my todo list.
msg273998 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-08-31 04:17
FYI in 3.6 the spelling has been changed to _EMPTY (Issue 27895)
msg275235 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-09 02:28
New changeset 468961cea562 by R David Murray in branch '3.5':
#27630: Be consistent in how _XXX/_encoded_XXX vars are initialized.
https://hg.python.org/cpython/rev/468961cea562

New changeset ddb1cf7b7eb1 by R David Murray in branch 'default':
Merge: #27630: Be consistent in how _XXX/_encoded_XXX vars are initialized.
https://hg.python.org/cpython/rev/ddb1cf7b7eb1
msg275236 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-09-09 02:30
Cleaned up the code.  It was basically working by accident with the misspelling.
History
Date User Action Args
2016-09-09 02:30:10r.david.murraysetstatus: open -> closed
resolution: fixed
messages: + msg275236

stage: resolved
2016-09-09 02:28:36python-devsetnosy: + python-dev
messages: + msg275235
2016-09-01 04:57:53rhettingersetassignee: r.david.murray
2016-08-31 04:17:28martin.pantersetmessages: + msg273998
2016-07-27 14:02:00r.david.murraysetmessages: + msg271451
2016-07-27 01:07:13martin.pantercreate