New submission from grumblor <gitgrumb...@gmail.com>:

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.

----------
components: Library (Lib)
messages: 388498
nosy: grumblor
priority: normal
severity: normal
status: open
title: http.server.BaseHTTPRequestHandler  end_header() fails
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43474>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to