I don't think that you should print the value of ```self.temp_dir``` here, because the function is trying to create a file in the default temporary directory of the ```tempfile``` module (note the absence of the ```dir``` parameter in the call to ```tempfile.TemporaryFile```).