Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f04750b

Browse files
vaclavbartosmiss-islington
authored andcommitted
bpo-38361: syslog: fixed making default "ident" from sys.argv[0] (GH-16557)
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
1 parent b679137 commit f04750b

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed an issue where ``ident`` could include a leading path separator when :func:`syslog.openlog` was called without arguments.

Modules/syslogmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ syslog_get_argv(void)
9999
if (slash == -2)
100100
return NULL;
101101
if (slash != -1) {
102-
return PyUnicode_Substring(scriptobj, slash, scriptlen);
102+
return PyUnicode_Substring(scriptobj, slash + 1, scriptlen);
103103
} else {
104104
Py_INCREF(scriptobj);
105105
return(scriptobj);

0 commit comments

Comments
 (0)