You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is about HTTP server library (found on Windows with python 3.9, not sure other platforms).
In file Lib\http\server.py, we define:
class BaseHTTPRequestHandler(...):
def log_message(self, format, *args):
sys.stderr.write(...)
In certain cases, sys.stderr could be None and thus this function call will throw exception. My use case: I created an XMLRPC server (SimpleXMLRPCRequestHandler derives from BaseHTTPRequestHandler) within a Windows service. I guess with that combination, sys.stderr will be None. When this issue happens, the client got empty response and not much error log for debugging.
It looks https://bugs.python.org/issue43348 has the same root cause as this one. When running with pythonservice.exe or pythonw.exe, sys.stderr will be None and thus causing crash when logging messages (calling sys.stderr.write).
terryjreedy
changed the title
HTTP request handler should check sys.stderr for None before use for logging
HTTP request handler: check sys.stderr != None before logging
Aug 13, 2021
terryjreedy
changed the title
HTTP request handler should check sys.stderr for None before use for logging
HTTP request handler: check sys.stderr != None before logging
Aug 13, 2021
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: