btw this is not safe if you have multiple threads/processes running at the same time. You can use as well mkdtemp with prefix of `cfg['CFG_TMPDIR']`.