New submission from Kirill Pinchuk <cybergr...@gmail.com>:

Probably we should make the behavior of SysLogHandler consistent with other 
Socket handlers.

Right now SocketHandler and DatagramHandler implement such behavior:

1) on `close` set `self.socket = None`
2) when trying to send - make socket when it is None


SysLogHandler doesn't implement this behavior and when you close the socket for 
some reason (eg. restart of uWSGI server on code change) it leaves it in the 
closed state, then raises an error when you try to send any message because it 
is closed

```
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.9/logging/handlers.py", line 959, in emit
    self.socket.sendto(msg, self.address)
OSError: [Errno 9] Bad file descriptor

```

----------
components: Library (Lib)
messages: 394932
nosy: Kirill Pinchuk
priority: normal
severity: normal
status: open
title: Unify logging.handlers.SysLogHandler behavior with SocketHandlers
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

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

Reply via email to