[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-06-21 Thread Petri Lehtinen
New submission from Petri Lehtinen : This seems like a common feature request. Many people suffer from the fact that upon flush, the contents of single-file mailboxes are written into a new file which is then renamed over the old file. For example: #1599254, #5346, #7359, #7360, #9559, The o

[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-06-21 Thread Petri Lehtinen
Changes by Petri Lehtinen : -- components: +email nosy: +barry, r.david.murray ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-06-21 Thread R. David Murray
R. David Murray added the comment: It would be nice to do some research on what MUAs that support mbox format do here. (eg: mutt, pine if it still exists, etc). -- ___ Python tracker

[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-06-21 Thread Petri Lehtinen
Petri Lehtinen added the comment: I actually already researched mutt 1.5.21 (on Ubuntu), and it seems to overwrite the file in-place. At least the inode number doesn't change when I append and/or delete files from an mbox file and save it. -- ___ P

[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-06-21 Thread Petri Lehtinen
Petri Lehtinen added the comment: Now I also tested rmail (the Emacs email client). It seems to write-and-rename, at least the inode number changes. It seems to even use the mboxo format nowadays (used to use Babyl). -- ___ Python tracker

[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-06-21 Thread Petri Lehtinen
Petri Lehtinen added the comment: Alpine (the successor of pine) also seems to overwrite in-place, just like mutt. -- ___ Python tracker ___

[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-06-21 Thread R. David Murray
R. David Murray added the comment: Any chance you'd be willing to look in the source code and see if they do any locking mailbox doesn't? The evidence you've already gathered is probably enough to justify adding the option, though. -- ___ Python t

[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-06-21 Thread Petri Lehtinen
Petri Lehtinen added the comment: I looked at the source code of mutt to see how it rewrites mbox files. It does roughly this: 1. Block some signals. 2. Lock the mbox file (with dotlock, fcntl and flock). 3. Create a temporary file in /tmp. 4. Write messages to the temporary file, from the

[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-07-02 Thread Petri Lehtinen
Petri Lehtinen added the comment: This might be the only way to fix #1599254, see http://bugs.python.org/issue1599254#msg30590. If another program is waiting on the fcntl lock (and doesn't use dotlocking), as soon as mailbox.py closes the original file (to replace it with a new file) and rele

[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-08-06 Thread Petri Lehtinen
Petri Lehtinen added the comment: Thinking about this again, I guess the original design rationale was not to prepare for crashes, but for the ease of implementation. It's not generally possible to rewrite the mailbox fully in-place, because the messages are not loaded into memory. If the orde