Message30598
| Author |
akuchling |
| Recipients |
| Date |
2006年12月20日.14:46:13 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
Attaching a patch that adds length checking: before doing a flush() on a single-file mailbox, seek to the end and verify its length is unchanged. It raises an ExternalClashError if the file's length has changed. (Should there be a different exception for this case, perhaps a subclass of ExternalClashError?)
I verified that this change works by running a program that added 25 messages, pausing between each one, and then did 'echo "new line" > /tmp/mbox' from a shell while the program was running.
I also noticed that the self._lookup() call in self.flush() wasn't necessary, and replaced it by an assertion.
I think this change should go on both the trunk and 25-maint branches.
File Added: length-checking.diff |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2007年08月23日 14:50:00 | admin | link | issue1599254 messages |
| 2007年08月23日 14:50:00 | admin | create |
|