Author canvon
Recipients canvon
Date 2016-08-27.09:48:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1472291311.49.0.485322574022.issue27875@psf.upfronthosting.co.za>
In-reply-to
Content
When calling syslog.syslog() without calling syslog.openlog() before, openlog() gets called with no arguments. Documentation says: "The optional ident keyword argument is a string which is prepended to every message, and defaults to sys.argv[0] with leading
path components stripped." -- "35.13. syslog — Unix syslog library routines"

It leaves the final slash in, though. This produces syslog output for /usr/sbin/foo with identifier "/foo" instead of "foo". When reading syslog unprepared, one can easily think that to be a bug in the specific python script at hand (which it's not), or a chroot to be involved (which it's not, usually). So I consider this a bug.

On freenode/#python I was referred to https://github.com/python/cpython/blob/master/Modules/syslogmodule.c#L98 for the code that does this.

This issue is forwarded from a minor bug report reported by me at Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835577

A test script is attached, which, when called with absolute path, produces this in syslog:

  Aug 27 08:53:27 blackbox /test-syslog.py: Test from python!

The slash is misleading/wrong.
History
Date User Action Args
2016-08-27 09:48:31canvonsetrecipients: + canvon
2016-08-27 09:48:31canvonsetmessageid: <1472291311.49.0.485322574022.issue27875@psf.upfronthosting.co.za>
2016-08-27 09:48:31canvonlinkissue27875 messages
2016-08-27 09:48:31canvoncreate