В Воскресенье, 15 апр. 2018 в 1:12 , Serhiy Storchaka
Actually the reliable code should write into a separate file and
the original file by the new file only if writing is successful. Or
backup the old file and restore it if writing is failed. Or do both.
handle hard and soft links if necessary. And use file locks if needed
prevent race condition when read/write by different processes.
on the specific of the application you may need different code. Your
three lines are enough for a one-time script if the risk of a powerful
blackout or disk space exhaustion is insignificant or if the data is
I not sure that solving described problems is a task of this level,
maybe it problem for higher level
Python-ideas mailing list
Code of Conduct: http://python.org/psf/codeofconduct/