From 8f0bea7b3deee488bb5152e8cd13c800a85df5aa Mon Sep 17 00:00:00 2001 From: Parker Date: Sun, 26 Apr 2020 22:05:32 -0400 Subject: [PATCH 1/4] Fixes Python Logging API Change The logging module added a stacklevel=1 kwarg in python3.8 We need to do the same since we override that method. --- st2common/st2common/log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/st2common/st2common/log.py b/st2common/st2common/log.py index 15c25002a5..244210010d 100644 --- a/st2common/st2common/log.py +++ b/st2common/st2common/log.py @@ -68,7 +68,7 @@ _srcfile = get_normalized_file_path(__file__) -def find_caller(stack_info=None): +def find_caller(stack_info=None, stacklevel=1): """ Find the stack frame of the caller so that we can note the source file name, line number and function name. From c58601d65b266fc4e7ccecba672c5d005467c451 Mon Sep 17 00:00:00 2001 From: Parker Date: Tue, 28 Apr 2020 19:52:13 -0400 Subject: [PATCH 2/4] uses kwargs instead --- st2common/st2common/log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/st2common/st2common/log.py b/st2common/st2common/log.py index 244210010d..29114d5c18 100644 --- a/st2common/st2common/log.py +++ b/st2common/st2common/log.py @@ -68,7 +68,7 @@ _srcfile = get_normalized_file_path(__file__) -def find_caller(stack_info=None, stacklevel=1): +def find_caller(*args, **kwargs): """ Find the stack frame of the caller so that we can note the source file name, line number and function name. From 12ac467fcc1193a40f3fe87f99097b8c474ad0dc Mon Sep 17 00:00:00 2001 From: Nick Maludy Date: Thu, 1 Oct 2020 14:00:39 -0400 Subject: [PATCH 3/4] Added CHANGELOG entry for find_caller logging fix --- CHANGELOG.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3ca0de1b7b..5dccd41827 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -90,6 +90,10 @@ Fixed * Fixed a regression in the ``linux.dig`` action on Python 3. (bug fix) #4993 Contributed by @blag +* Fixed a compatibility issue with the latest version of the ``logging`` library API + where the ``find_caller()`` function introduced some new variables. (bug fix) + + Contributed by @Dahfizz9897 Removed ~~~~~~~ From a70b83540609c3c9770ed539429a2c6f8025b871 Mon Sep 17 00:00:00 2001 From: Nick Maludy Date: Fri, 2 Oct 2020 10:45:11 -0400 Subject: [PATCH 4/4] Update CHANGELOG.rst Co-authored-by: Eugen C. --- CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 931a0e166f..4b119fb183 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -99,7 +99,7 @@ Fixed Contributed by @misterpah * Fixed a compatibility issue with the latest version of the ``logging`` library API - where the ``find_caller()`` function introduced some new variables. (bug fix) + where the ``find_caller()`` function introduced some new variables. (bug fix) #4923 Contributed by @Dahfizz9897