Eryk Sun added the comment:

For anyone interested, this issue is solvable on Windows by working around how 
O_TEMPORARY is implemented. To do this the _winapi module would need a wrapper 
for SetFileInformationByHandle (available in Vista+), which would need to 
support at least FileDispositionInfo. 

That said, the use case of replacing a file is better supported by calling the 
Windows API function ReplaceFile anyway. It isn't atomic, however. I don't 
think that's possible in general on Windows. The problem is that, unlike on 
Unix, an open file on Windows can't be anonymous. So if the replaced file is 
already open, it has to first be renamed before the replacement file can take 
its place. That creates a small window for things to go wrong.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21579>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to