New submission from Cyril Bouthors:

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)
close(3)                                = 0
rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x7fc899e4a8d0}, {0x55e6b0, [], 
SA_RESTORER, 0x7fc899e4a8d0}, 8) = 0
brk(0x20ed000)                          = 0x20ed000
exit_group(0)                           = ?
+++ exited with 0 +++

I've tested all those versions:

echo -e "import syslog\nsyslog.syslog('test')\n" | python3.5
echo -e "import syslog\nsyslog.syslog('test')\n" | python3.4
echo -e "import syslog\nsyslog.syslog('test')\n" | python3.3
echo -e "import syslog\nsyslog.syslog('test')\n" | python3.2
echo -e "import syslog\nsyslog.syslog('test')\n" | python2.7
echo -e "import syslog\nsyslog.syslog('test')\n" | python2.6

Can we please get syslog() to report errors?

Thanks.

----------
components: Library (Lib)
messages: 248462
nosy: Cyril Bouthors
priority: normal
severity: normal
status: open
title: syslog.syslog() does not return error when unable to send the log
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5

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

Reply via email to