File bpo38361-syslog-no-slash-ident.patch of Package python3.33305

From 73f8e9ef9b56350a22ccf8224ddb144b5f35e1d7 Mon Sep 17 00:00:00 2001
From: Vaclav Bartos <bartos@cesnet.cz>
Date: Thu, 3 Oct 2019 10:27:47 +0000
Subject: [PATCH 1/2] syslog: fixed making default "ident" from sys.argv[0]

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'.
---
 Misc/NEWS.d/next/Library/2019-10-04-09-49-56.bpo-38361.LM4u4T.rst |    1 +
 Modules/syslogmodule.c                                            |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

--- /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
--- 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);
openSUSE Build Service is sponsored by