I prefer this form as os is a wrapper around system calls, while mkstemp is a python library function
as implemented is also just a wrapper around a system call (libc actually) so its perfectly fine, but it feels wrong to violate layers like that. it would be nicer if mkstemp would be in the os module.