change mkstemppath to use NamedTemporaryFile, hoping will work on mac os x