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

From: eryk sun
Sent: Sunday, 29 July 2018 15:28
To: python-dev@python.org
Subject: Re: [Python-Dev] Tests failing on Windows with TESTFN

On Sun, Jul 29, 2018 at 12:35 PM, Steve Dower <steve.do...@python.org> wrote:
>
> One additional thing that may help (if support.unlink doesn't already do it)
> is to rename the file before deleting it. Renames are always possible even
> with open handles, and then you can create a new file at the original name.

Renaming open files typically fails with a sharing violation (32).
Most programs open files with read and write sharing but not delete
sharing. This applies to Python, except temporary files (i.e.
os.O_TEMPORARY) do share delete access. Renaming a file is effectively
adding a new link and deleting the old link, so it requires opening
the file with delete access. Also, renaming a directory that has open
files in the tree fails with access denied (5).
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40python.org

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to