Flush files before fsync'ing

This commit is contained in:
Unrud 2017-09-24 02:01:13 +02:00
parent 21f5f5d70b
commit ed6335aa15

View File

@ -771,6 +771,7 @@ class Collection(BaseCollection):
newline=newline, encoding=None if "b" in mode else self._encoding) newline=newline, encoding=None if "b" in mode else self._encoding)
try: try:
yield tmp yield tmp
tmp.flush()
try: try:
self._fsync(tmp.fileno()) self._fsync(tmp.fileno())
except OSError as e: except OSError as e: