Properly close a temporary TextIOWrapper in 'email'.
diff --git a/Lib/email/parser.py b/Lib/email/parser.py
index b83e0f7..6caaff5 100644
--- a/Lib/email/parser.py
+++ b/Lib/email/parser.py
@@ -120,7 +120,8 @@
         meaning it parses the entire contents of the file.
         """
         fp = TextIOWrapper(fp, encoding='ascii', errors='surrogateescape')
-        return self.parser.parse(fp, headersonly)
+        with fp:
+            return self.parser.parse(fp, headersonly)
 
 
     def parsebytes(self, text, headersonly=False):