[issue44055] NamedTemporaryFile opened twice on Windows

2021-05-10 Thread Lumír Balhar
Lumír Balhar added the comment: I understand, thanks for the explanation. I'd like to improve the documentation to make it more clear that the file actually can be reopened on Windows when you use delete=False but I cannot find the right words :/ What about: That name can be retrieved from

[issue44055] NamedTemporaryFile opened twice on Windows

2021-05-06 Thread Eryk Sun
Eryk Sun added the comment: Your example uses delete=False. In Windows, the provision about reopening the file while it's open applies to delete=True. With the latter, the file is opened with the O_TEMPORARY flag. At the OS level, this flag modifies the CreateFileW() call as follows: d

[issue44055] NamedTemporaryFile opened twice on Windows

2021-05-06 Thread Lumír Balhar
New submission from Lumír Balhar : Hello. The documentation about tempfile.NamedTemporaryFile[0] contains: That name can be retrieved from the name attribute of the returned file-like object. Whether the name can be used to open the file a second time, while the named temporary file is still