Replace tempdir
dependency with tempfile
#3337
Merged
tempdir
dependency with tempfile
#3337