Message248462
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. |
|
Date |
User |
Action |
Args |
2015-08-12 17:01:25 | Cyril Bouthors | set | recipients:
+ Cyril Bouthors |
2015-08-12 17:01:25 | Cyril Bouthors | set | messageid: <1439398885.55.0.81268943259.issue24850@psf.upfronthosting.co.za> |
2015-08-12 17:01:25 | Cyril Bouthors | link | issue24850 messages |
2015-08-12 17:01:24 | Cyril Bouthors | create | |
|