This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: mailbox module, two small fixes
Type: behavior Stage: patch review
Components: email, Library (Lib) Versions: Python 3.1, Python 3.2, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: barry, georg.brandl, gpolo, petri.lehtinen, r.david.murray, vstinner
Priority: normal Keywords: patch

Created on 2008-06-01 21:29 by gpolo, last changed 2022-04-11 14:56 by admin.

Files
File name Uploaded Description Edit
mailbox_fixes.diff gpolo, 2008-06-01 21:29
test_get_message_with_sequences.diff gpolo, 2008-06-01 22:05
mailbox.patch vstinner, 2008-10-31 17:00
Messages (8)
msg67605 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2008-06-01 21:29
While fixing the tkinter demos, I found some problems when moving from
mhlib to mailbox that are corrected in the attached patch.

The first fix:

-        for name, key_list in self.get_sequences():
+        for name, key_list in self.get_sequences().iteritems():

I'm not sure someone else used the module before, or at least
get_sequences() since it returns a dict and it just fails in the current
code.

The second fix is about the .mh_sequences file format I found here, it
may have some lines with one space, or two, after its content which was
causing the get_sequences() to fail too.
msg67606 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2008-06-01 21:33
Erm.. sorry, the first correction is directly related to get_message not
get_sequences per se.
msg67607 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2008-06-01 22:05
Added a test case
msg75420 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2008-10-31 17:00
@gpolo: your patch is correct, but I prefer line.rstrip() to 
line.strip(). My new patch combines your two patches + replace strip 
by rstrip + use itervalues() instead of items() in MH.pack().
msg83718 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2009-03-17 23:49
Ping. Nobody is interested by the patch?
msg88680 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-06-01 21:31
The iteritems problem was fixed in r71046 from issue2625.  The tests in
mailbox.patch all pass at this point, though it doesn't look like the
line with blanks issue has been addressed in the code.
msg110639 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-07-18 11:57
Anyone interested in taking this forward?
msg111412 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-07-24 01:48
self.get_sequences() => self.get_sequences().iteritems() was fixed in trunk (r71046) and py3k (r71067).

The patch on .get_sequences() has no test: (test_get_message_with_sequences() doesn't fail without the patch.
History
Date User Action Args
2022-04-11 14:56:35adminsetgithub: 47272
2014-02-03 19:07:28BreamoreBoysetnosy: - BreamoreBoy
2012-10-06 15:51:41r.david.murraysetnosy: + petri.lehtinen, barry
components: + email
2012-10-06 11:20:51georg.brandlsetassignee: georg.brandl ->
2010-07-24 01:48:49vstinnersetkeywords: patch, patch

messages: + msg111412
2010-07-18 11:57:18BreamoreBoysetversions: + Python 3.2, - Python 2.6, Python 3.0
nosy: + BreamoreBoy

messages: + msg110639

keywords: patch, patch
2009-06-01 21:31:52r.david.murraysetversions: + Python 3.1, Python 2.7
nosy: + r.david.murray

messages: + msg88680

keywords: patch, patch
2009-04-22 14:37:59ajaksu2setpriority: normal
keywords: patch, patch
type: behavior
stage: patch review
2009-03-17 23:49:44vstinnersetkeywords: patch, patch

messages: + msg83718
2008-10-31 17:00:20vstinnersetkeywords: patch, patch
nosy: + vstinner
messages: + msg75420
files: + mailbox.patch
2008-06-02 21:59:15georg.brandlsetkeywords: patch, patch
assignee: georg.brandl
nosy: + georg.brandl
2008-06-01 22:05:31gpolosetkeywords: patch, patch
files: + test_get_message_with_sequences.diff
messages: + msg67607
2008-06-01 21:33:33gpolosetkeywords: patch, patch
messages: + msg67606
2008-06-01 21:29:32gpolocreate