The default value of "ident" parameter should be sys.argv[0] with leading path
components stripped, but it contained the last slash, i.e. '/program' instead
of 'program'.
BPO issue: https://bugs.python.org/issue38361
https://bugs.python.org/issue38361
--- /dev/null
+Fixed an issue where ``ident`` could include a leading path separator when :func:`syslog.openlog` was called without arguments.
\ No newline at end of file
if (slash == -2)
return NULL;
if (slash != -1) {
- return PyUnicode_Substring(scriptobj, slash, scriptlen);
+ return PyUnicode_Substring(scriptobj, slash + 1, scriptlen);
} else {
Py_INCREF(scriptobj);
return(scriptobj);