mirror of
https://github.com/python/cpython.git
synced 2024-12-14 04:17:19 +08:00
c57a285cb4
Ensure that a tempfile can be closed any number of times without error. This wasn't true on Windows.
11 lines
227 B
Python
11 lines
227 B
Python
# 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()
|