New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syslog.syslog() does not return error when unable to send the log #69038
Comments
Hi guys, syslog.syslog() does not report any error when it fails to send messages to syslog. To reproduce: Stop sysglog: sudo /etc/init.d/rsyslog stop Run than Python code: import syslog
syslog.syslog('test') It does not fail. Strace shows that's it's been unable to send the message to syslog: connect(3, {sa_family=AF_LOCAL, sun_path="/dev/log"}, 110) = -1 ENOENT (No such file or directory) I've tested all those versions: echo -e "import syslog\nsyslog.syslog('test')\n" | python3.5 Can we please get syslog() to report errors? Thanks. |
Hmm. Normally the way errors are reported in python is via exception. personally I would not want syslog raising an exception if it couldn't deliver the message. I suppose we could have it return a status code. That would be a new feature, though. |
I’ve never used syslog() in Python, but I thought I should point out that the standard Posix API does not do any error reporting either. See <http://pubs.opengroup.org/onlinepubs/9699919799/functions/syslog.html\>: “The . . . functions shall not return a value. / No errors are defined.” |
Ah, in that case there aren't any errors for us to return, so this is moot. |
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: