summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS.d/next/Library/2019-10-04-09-49-56.bpo-38361.LM4u4T.rst1
-rw-r--r--Modules/syslogmodule.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/Misc/NEWS.d/next/Library/2019-10-04-09-49-56.bpo-38361.LM4u4T.rst b/Misc/NEWS.d/next/Library/2019-10-04-09-49-56.bpo-38361.LM4u4T.rst
new file mode 100644
index 0000000..65186db
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-10-04-09-49-56.bpo-38361.LM4u4T.rst
@@ -0,0 +1 @@
+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
diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c
index b2ea73b..539224f 100644
--- a/Modules/syslogmodule.c
+++ b/Modules/syslogmodule.c
@@ -99,7 +99,7 @@ syslog_get_argv(void)
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);