grumblor added the comment:
perhaps simply returning the method if _headers_buffer isn't defined is better
since there is probably nothing to flush.
def end_headers(self):
if not hasattr(self, '_headers_buffer'):
return 1
"""
New submission from grumblor :
Python Version 3.8
http.server version 0.6
This is current install in new xubuntu 20.04 LTS, no idea if this is fixed in
other version but appears to be present on github
https://github.com/python/cpython/blob/3.9/Lib/http/server.py
at line 525