--- Lib/mailbox.py.copyback 2007-01-13 15:45:49.000000000 +0000 +++ Lib/mailbox.py 2007-01-13 17:06:39.000000000 +0000 @@ -21,6 +21,7 @@ import rfc822 import StringIO import shutil +import warnings try: if sys.platform == 'os2emx': # OS/2 EMX fcntl() not adequate @@ -583,6 +584,12 @@ '(expected %i, found %i)' % (self._file_length, cur_len)) + if fcntl and self._locked and not hasattr(self._file, 'truncate'): + warnings.warn('as file.truncate() is unavailable, flush() may ' + 'momentarily release the fcntl lock; if you depend ' + 'on fcntl locking, you should regard flush() as ' + 'invalidating the message keys', RuntimeWarning, + stacklevel=2) orig_file = self._file remove_temp_file = True new_file = _create_temporary(self._path)