diff options
-rwxr-xr-x | Lib/cgi.py | 6 | ||||
-rw-r--r-- | Misc/NEWS | 2 |
2 files changed, 8 insertions, 0 deletions
@@ -552,6 +552,12 @@ class FieldStorage: else: self.read_single() + def __del__(self): + try: + self.file.close() + except AttributeError: + pass + def __repr__(self): """Return a printable representation.""" return "FieldStorage(%r, %r, %r)" % ( @@ -38,6 +38,8 @@ Core and Builtins Library ------- +- Issue #18394: Close cgi.FieldStorage's optional file. + - Issue #17702: On error, os.environb now removes suppress the except context when raising a new KeyError with the original key. |