tiny fixed coding style: ``from os import path`` => ``import os, os.path``

(cherry picked from commit 6bce2682b6e8b08234d9927597c5cfa292ccb6f0)
atomic write to file

(cherry picked from commit a34b7f107137d1bc76588ffe50f12da1a8531dd7)