Index: Lib/mailbox.py =================================================================== --- Lib/mailbox.py (revision 52779) +++ Lib/mailbox.py (working copy) @@ -1887,7 +1887,8 @@ def _sync_flush(f): """Ensure changes to file f are physically on disk.""" f.flush() - os.fsync(f.fileno()) + if hasattr(os, 'fsync'): + os.fsync(f.fileno()) def _sync_close(f): """Close file f, ensuring all changes are physically on disk."""