[Python-Dev] Tests failing on Windows with TESTFN

Jeremy Kloth jeremy.kloth at gmail.com
Sat Jul 28 21:04:07 EDT 2018

On Sat, Jul 28, 2018 at 6:43 PM Brett Cannon <brett at python.org> wrote:
> If Windows doesn't clean up its temp directory on a regular basis then that doesn't suggest to me not to use tempfile, but instead that the use of tempfile still needs to clean up after itself. And if there is a lacking feature in tempfile then we should add it instead of a avoiding the module.

Mind you, this is mentioned in the confines of the test harness where
just about anything can happen (and usually does!).  Something that
cannot be coded against using just tempfile is cleanup on process
abort.  The per-process-directory approach handles this case.

I would think it is desired to have no leftovers after running the
test harness (especially in regards to the buildbots).

Now, I'm not sure the exact cause of all of the leftovers in the TEMP
directory, but it is definitely something that is currently happening
(and shouldn't be).  It is not exactly the easiest of tasks to track
the file usage of every test in the test suite.  It is certainly
easier to replace usages of os.unlink with test.support.unlink within
the test suite.

Jeremy Kloth

More information about the Python-Dev mailing list