mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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
This commit is contained in:
parent
b6791375b2
commit
f04750bb7a
2 changed files with 2 additions and 1 deletions
|
@ -0,0 +1 @@
|
|||
Fixed an issue where ``ident`` could include a leading path separator when :func:`syslog.openlog` was called without arguments.
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue