This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Cyril Bouthors
Recipients Cyril Bouthors
Date 2015-08-12.17:01:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1439398885.55.0.81268943259.issue24850@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-08-12 17:01:25Cyril Bouthorssetrecipients: + Cyril Bouthors
2015-08-12 17:01:25Cyril Bouthorssetmessageid: <1439398885.55.0.81268943259.issue24850@psf.upfronthosting.co.za>
2015-08-12 17:01:25Cyril Bouthorslinkissue24850 messages
2015-08-12 17:01:24Cyril Bouthorscreate