[issue38780] SysLogHandler crash atexit

Alan Robertson report at bugs.python.org
Wed Jan 8 08:51:35 EST 2020


Alan Robertson <alanr at unix.sh> added the comment:

There are a variety of different reasons this can fail, not just on MacOS. You could give it a bad IP address of a server, etc. [That was my particular case].

The constructor should create an attribute 'socket' and initialize it to None early on. Then, the close function in logging/handlers.py should check for None. Or alternatively, it shouldn't register the object with atexit until it's been constructed "well-enough".

----------
nosy: +alanr

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


More information about the Python-bugs-list mailing list