Index: Lib/mailbox.py =================================================================== --- Lib/mailbox.py (révision 76002) +++ Lib/mailbox.py (copie de travail) @@ -458,11 +458,17 @@ def _refresh(self): """Update table of contents mapping.""" - new_mtime = os.path.getmtime(os.path.join(self._path, 'new')) - cur_mtime = os.path.getmtime(os.path.join(self._path, 'cur')) - - if (self._last_read is not None and - new_mtime <= self._last_read and cur_mtime <= self._last_read): + for subdir in ('new', 'cur'): + path = os.path.join(self._path, subdir) + fd = os.open(path, os.O_RDONLY) + try: + os.fsync(fd) + finally: + os.close(fd) + mtime = os.path.getmtime(path) + if self._last_read is None or mtime >= self._last_read: + break + else: return self._toc = {}