Apr-04-2021, 04:17 PM
You've set up a context for the temp directory, but not for the
On linux, an open file doesn't matter, you can still delete the file and the directory. But on Windows, the removal will fail.
Either explictly
tfp
file. So when the end of the code is reached, the tfp file isn't immediately closed. On linux, an open file doesn't matter, you can still delete the file and the directory. But on Windows, the removal will fail.
Either explictly
close()
the tfp file, or open it in a with
context so that it is closed before the end of the TemporaryDirectory context.