Message30598
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 |
|
Date |
User |
Action |
Args |
2007-08-23 14:50:00 | admin | link | issue1599254 messages |
2007-08-23 14:50:00 | admin | create | |
|