[issue8604] Adding an atomic FS write API

STINNER Victor report at bugs.python.org
Thu May 16 01:50:03 CEST 2013


STINNER Victor added the comment:

atomic_write.patch calls os.replace(src, dst) whereas the src file is open. It works on Linux, but it sounds a little bit strange to me and may fail on other platforms.

Here is another patch (atomic_write_mkstemp.patch) using tempfile.mkstemp() instead of tempfile.NamedTemporaryFile(delete=True) to control when the file is closed and removed.

----------
Added file: http://bugs.python.org/file30275/atomic_write_mkstemp.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8604>
_______________________________________


More information about the Python-bugs-list mailing list