Commit 807a5a16 authored by Benjamin Peterson's avatar Benjamin Peterson

close files properly

parent 9f5f65c7
......@@ -182,10 +182,12 @@ class CgiTests(unittest.TestCase):
return a
f = TestReadlineFile(tempfile.TemporaryFile("w+"))
self.addCleanup(f.close)
f.write('x' * 256 * 1024)
f.seek(0)
env = {'REQUEST_METHOD':'PUT'}
fs = cgi.FieldStorage(fp=f, environ=env)
self.addCleanup(fs.file.close)
# if we're not chunking properly, readline is only called twice
# (by read_binary); if we are chunking properly, it will be called 5 times
# as long as the chunksize is 1 << 16.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment