SF bug #476138: tempfile behavior across platforms

Ensure that a tempfile can be closed any number of times without error.
This wasn't true on Windows.
This commit is contained in:
Tim Peters 2001-10-29 21:46:08 +00:00
parent e59feb5edc
commit c57a285cb4
2 changed files with 16 additions and 4 deletions

10
Lib/test/test_tempfile.py Normal file
View file

@ -0,0 +1,10 @@
# SF bug #476138: tempfile behavior across platforms
# Ensure that a temp file can be closed any number of times without error.
import tempfile
f = tempfile.TemporaryFile("w+b")
f.write('abc\n')
f.close()
f.close()
f.close()