-
-
Notifications
You must be signed in to change notification settings - Fork 745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed python 3 incompatibility in logging API implemenation of findCaller (v3.3 cherry pick) #5059
Conversation
Update orquesta verison to v1.2.0
st2common/st2common/log.py
Outdated
and expects a 4-element tuple to be returned, rather than a 3-element tuple in | ||
the python 2 implementation. | ||
We derived our implementation from the Python 3.9 source code here: | ||
https://github.com/python/cpython/blob/3.9/Lib/logging/__init__.py#L1376-L1404 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/python/cpython/blob/3.9/Lib/logging/__init__.py#L1376-L1404 | |
https://github.com/python/cpython/blob/3.9/Lib/logging/__init__.py#L1502-L1536 |
Co-authored-by: Jacob Floyd <[email protected]>
I installed the package from this PR onto U18 and it did get rid of most of the unknown file messages in the logs. I'm still left with "unknown file" on exception in the st2sensorcontainer log:
|
@amanda11 can you confirm if that is a new problem or one that already exists in 3.2? |
I think it probably exists on 3.2 as 3.2 had lots of "unknown file" messages, but I'll confirm - I have to break a system to get the exception! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - I willl raise a separate issue for the "unknown module" on exceptions in sensor container on py3 (if one already doesn't exist), after confirming that the problem also exists on 3.2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Closes #5057
See that issue for description of what the problem was. The fix was simply to ensure our implementation handles both the python 2 version and returns a 3-tuple, along with the python 3 version which returns a 4-tuple and is based on the code here: https://github.com/python/cpython/blob/3.9/Lib/logging/__init__.py#L1502-L1536
I've tested this change both my a python 2.7 (centos7) and python 3.6 (centos8 and ubuntu18) box and the logging modules are returned properly.