summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tempfile.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-10-29 21:46:08 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-10-29 21:46:08 (GMT)
commitc57a285cb4cd61439fd3ea804184ed8a8a1ac358 (patch)
tree5d02a253374face30c3a65c4be3bee4fd39fd2d3 /Lib/test/test_tempfile.py
parente59feb5edc40a052995ed122bf67d0a8ab7ea8c2 (diff)
downloadcpython-c57a285cb4cd61439fd3ea804184ed8a8a1ac358.zip
cpython-c57a285cb4cd61439fd3ea804184ed8a8a1ac358.tar.gz
cpython-c57a285cb4cd61439fd3ea804184ed8a8a1ac358.tar.bz2
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.
Diffstat (limited to 'Lib/test/test_tempfile.py')
-rw-r--r--Lib/test/test_tempfile.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py
new file mode 100644
index 0000000..286e79c
--- /dev/null
+++ b/Lib/test/test_tempfile.py
@@ -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()