Using shutil.copy is not atomic. The only guaranteed atomic operation is
os.rename, which requires source and target to be on the same filesystem.
Ensure this by resolving the real file path in case it is symlink and place
the tmp file in the same directory.
Using shutil.copy is not atomic. The only guaranteed atomic operation is os.rename, which requires source and target to be on the same filesystem. Ensure this by resolving the real file path in case it is symlink and place the tmp file in the same directory.
Signed-off-by: Julian Scheel julian@jusst.de