Index: Lib/test/test_pipes.py =================================================================== --- Lib/test/test_pipes.py (revision 76700) +++ Lib/test/test_pipes.py (working copy) @@ -36,7 +36,9 @@ open(TESTFN, 'w').write('hello world #2') t = pipes.Template() t.append(s_command + ' < $IN', pipes.FILEIN_STDOUT) - self.assertEqual(t.open(TESTFN, 'r').read(), 'HELLO WORLD #2') + testfn = t.open(TESTFN, 'r') + self.assertEqual(testfn.read(), 'HELLO WORLD #2') + testfn.close() def testEmptyPipeline1(self): # copy through empty pipe