[issue38780] SysLogHandler crash atexit

Erlend Egeberg Aasland report at bugs.python.org
Fri Feb 28 17:00:50 EST 2020


Erlend Egeberg Aasland <erlend.aasland at innova.no> added the comment:

Attached patch is based on Ronald Oussoren's and Alan Robertson's comments: Initialise self.socket to None early in __init()__, and then check for None in close() and emit(). Passes make test on 3.9, 3.8 and 3.7.

If this solution is ok I'll add a unit test for the case that triggered this report and prepare a PR.

----------
keywords: +patch
nosy: +erlendaasland
Added file: https://bugs.python.org/file48932/0001-bpo-38780-Harden-socket-use-in-logging.handlers.patch

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38780>
_______________________________________


More information about the Python-bugs-list mailing list