This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author grumblor
Recipients grumblor
Date 2021-03-11.11:09:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1615460999.3.0.75730553286.issue43474@roundup.psfhosted.org>
In-reply-to
Content
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

http.server.BaseHTTPRequestHandler end_headers() can reference _header_buffer array before it is assigned.

Should this be updated to something like the following? This fixes the problem of end_headers() failing for me:


    def end_headers(self):
        if not hasattr(self, '_headers_buffer'):
            self._headers_buffer = []
        """Send the blank line ending the MIME headers."""
        if self.request_version != 'HTTP/0.9':
            self._headers_buffer.append(b"\r\n")
            self.flush_headers()


This is my first issue, apologies for any mistakes I might have made.
History
Date User Action Args
2021-03-11 11:09:59grumblorsetrecipients: + grumblor
2021-03-11 11:09:59grumblorsetmessageid: <1615460999.3.0.75730553286.issue43474@roundup.psfhosted.org>
2021-03-11 11:09:59grumblorlinkissue43474 messages
2021-03-11 11:09:59grumblorcreate