Try to use test.support.unlink() instead of os.unlink(). It is purposed
for solving this issue.
> I started to address this years ago but things stalled. I'm happy to
> pick this up again and have another go, but I wanted to ask first
> whether there was any objection to my converting tests to using tempfile
> functions which should avoid the problem?
I think the only concern is that it is a pretty large change across many
files, and there is a risk of introducing bugs. Also, creating a
temporary file in setUp() may slowdown testing, especially if TESTFN is
not needed in every test.
On Sat, Jul 28, 2018 at 9:17 PM, Jeremy Kloth <jeremy...@gmail.com> wrote:
>
> *PLEASE*, don't use tempfile to create files/directories in tests. It
> is unfriendly to (Windows) buildbots. The current approach of
> directory-per-process ensures no test turds are left behind, whereas
> the tempfile solution slowly fills up my buildbot. Windows doesn't
> natively clean out the temp directory.
FYI, Windows 10 storage sense (under system->storage) can be
configured to delete temporary files on a schedule. Of course that
doesn't help with older systems.
_______________________________________________
Python-Dev mailing list
Pytho...@python.org
https://mail.python.org/mailman/listinfo/python-dev
On Sat, Jul 28, 2018, 15:13 eryk sun, <ery...@gmail.com> wrote:On Sat, Jul 28, 2018 at 9:17 PM, Jeremy Kloth <jeremy...@gmail.com> wrote:
>
> *PLEASE*, don't use tempfile to create files/directories in tests. It
> is unfriendly to (Windows) buildbots. The current approach of
> directory-per-process ensures no test turds are left behind, whereas
> the tempfile solution slowly fills up my buildbot. Windows doesn't
> natively clean out the temp directory.
FYI, Windows 10 storage sense (under system->storage) can be
configured to delete temporary files on a schedule. Of course that
doesn't help with older systems.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.
-Brett______________________________________________________________________________________________
Python-Dev mailing list
Pytho...@python.org
https://mail.python.org/mailman/listinfo/python-dev
Python-Dev mailing list
Pytho...@python.org
https://mail.python.org/mailman/listinfo/python-dev
If the problem is AV scanners, then they should be opening them properly for this (and since the delete is not failing but is being deferred, I assume it's allowing deletes). If the problem is elsewhere in our code base then we have a different bug.
Top-posted from my Windows 10 phone