[issue37560] with cgi.FieldStorage(...) fails on cleanup with AttributeError, missing try/except in __exit__

2019-07-17 Thread Ngalim Siregar
Change by Ngalim Siregar : -- keywords: +patch pull_requests: +14609 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14815 ___ Python tracker ___

[issue37560] with cgi.FieldStorage(...) fails on cleanup with AttributeError, missing try/except in __exit__

2019-07-11 Thread Stefanik Gábor
New submission from Stefanik Gábor : cgi.FieldStorage has this for its __del__ method: def __del__(self): try: self.file.close() except AttributeError: pass By contrast, __exit__ is missing the exception handler: def __exit__(self, *args):