Based on https://www.python.org/dev/peps/pep-0333/#specification-details
"If the iterable returned by the application has a close() method, the server or gateway must call that method upon completion of the current request, whether the request was completed normally, or terminated early due to an error. (This is to support resource release by the application. This protocol is intended to complement PEP 325 's generator support, and other common iterables with close() methods."
Based on https:/ /www.python. org/dev/ peps/pep- 0333/#specifica tion-details
"If the iterable returned by the application has a close() method, the server or gateway must call that method upon completion of the current request, whether the request was completed normally, or terminated early due to an error. (This is to support resource release by the application. This protocol is intended to complement PEP 325 's generator support, and other common iterables with close() methods."
here is a fix proposal : https:/ /review. openstack. org/#/c/ 193192/
It passes all tests, but I'm not very familiar with wsgi. So i don't know all the implications of adding a close() method.