File: test_tempfile.py

package info (click to toggle)
jython 2.2.1-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 18,708 kB
  • ctags: 46,200
  • sloc: python: 150,937; java: 86,267; xml: 1,080; perl: 104; sh: 93; makefile: 81; ansic: 24
file content (10 lines) | stat: -rw-r--r-- 227 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
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()