Don't rely on /tmp/goosetmp existing or being writable any more.  Use Python to determine an appropriate temporary directory.