[issue9559] mailbox.mbox creates new file when adding message to mbox

2012-06-29 Thread Petri Lehtinen
Changes by Petri Lehtinen : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ __

[issue9559] mailbox.mbox creates new file when adding message to mbox

2012-06-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3d7a75e945ee by Petri Lehtinen in branch '2.7': #9559: Don't call _pre_mailbox_hook more than once http://hg.python.org/cpython/rev/3d7a75e945ee New changeset 7cf5a629fde2 by Petri Lehtinen in branch '3.2': #9559: Don't call _pre_mailbox_hook more

[issue9559] mailbox.mbox creates new file when adding message to mbox

2012-06-28 Thread lilydjwg
Changes by lilydjwg : -- nosy: +lilydjwg ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/

[issue9559] mailbox.mbox creates new file when adding message to mbox

2012-06-28 Thread Petri Lehtinen
Petri Lehtinen added the comment: The _pre_mailbox_hook may be called twice, like this: babyl = mailbox.Babyl('new_file') babyl.add('foo\n') babyl.remove(0) babyl.add('bar\n') This only affects Babyl, that writes the mailbox header in _pre_mailbox_hook. The mailbox is corrupted on disk until

[issue9559] mailbox.mbox creates new file when adding message to mbox

2012-06-28 Thread Petri Lehtinen
Petri Lehtinen added the comment: See #15122 for always modifying single-file mailboxes in-place. -- ___ Python tracker ___ ___ Python

[issue9559] mailbox.mbox creates new file when adding message to mbox

2012-06-28 Thread Petri Lehtinen
Petri Lehtinen added the comment: Fixed. I removed the extra newlines. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue9559] mailbox.mbox creates new file when adding message to mbox

2012-06-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset c37cb11b546f by Petri Lehtinen in branch '2.7': #9559: Append data to single-file mailbox files if messages are only added http://hg.python.org/cpython/rev/c37cb11b546f New changeset 5f447a005d67 by Petri Lehtinen in branch '3.2': #9559: Append dat

[issue9559] mailbox.mbox creates new file when adding message to mbox

2012-06-26 Thread R. David Murray
R. David Murray added the comment: Could someone be depending on it? Sure. Is that likely enough to block this as a bug fix? Personally I think not. Appending to the mailbox when adding messages is, I think, the expected behavior, and always rewriting it is the surprising behavior. The p

[issue9559] mailbox.mbox creates new file when adding message to mbox

2012-06-26 Thread Petri Lehtinen
Petri Lehtinen added the comment: Attached a patch that doesn't rewrite+rename if messages have only been added. In this case, flush() only syncs the mailbox file to make sure all changes have been written to disk. David & Barry: what do you think about including this on bugfix releases? Coul

[issue9559] mailbox.mbox creates new file when adding message to mbox

2012-06-18 Thread Petri Lehtinen
Petri Lehtinen added the comment: This is actually not true. When calling add(), mbox (and MMDF and Babyl) append the message to the file without rewriting it. It's the following flush() call that rewrites the whole mailbox contents. I think this could be changed to work correctly by not sett

[issue9559] mailbox.mbox creates new file when adding message to mbox

2012-05-06 Thread Ezio Melotti
Changes by Ezio Melotti : -- stage: -> needs patch versions: +Python 3.3 -Python 3.1 ___ Python tracker ___ ___ Python-bugs-list maili

[issue9559] mailbox.mbox creates new file when adding message to mbox

2010-08-10 Thread R. David Murray
Changes by R. David Murray : -- nosy: +akuchling versions: +Python 3.1, Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue9559] mailbox.mbox creates new file when adding message to mbox

2010-08-10 Thread Chris Green
New submission from Chris Green : When you call mailbox.mbox.add() the old mbox file is copied, the new file is modified and then renamed to the name of the'old' mbox file. This breaks the way that many MUAs detect and manage new mail in an mbox, in particular I discovered this with mutt. If