[Python-checkins] r85992 - python/branches/py3k/Lib/test/test_cgi.py
benjamin.peterson
python-checkins at python.org
Sun Oct 31 00:59:37 CEST 2010
Author: benjamin.peterson
Date: Sun Oct 31 00:59:37 2010
New Revision: 85992
Log:
close files properly
Modified:
python/branches/py3k/Lib/test/test_cgi.py
Modified: python/branches/py3k/Lib/test/test_cgi.py
==============================================================================
--- python/branches/py3k/Lib/test/test_cgi.py (original)
+++ python/branches/py3k/Lib/test/test_cgi.py Sun Oct 31 00:59:37 2010
@@ -182,10 +182,12 @@
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.
More information about the Python-checkins
mailing list