-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix request_force_stop_sigrtmin failing for python3 #727
Fix request_force_stop_sigrtmin failing for python3 #727
Conversation
request_force_stop_sigrtmin would fail for python3 because it would try to read frame attributes that have been removed in python3 This patch fixes that by reading more fram attributes only for python2
Thanks! |
'f_lasti', 'f_lineno', 'f_locals', 'f_restricted', 'f_trace'] | ||
|
||
frame_properties = ['f_code', 'f_lasti', 'f_lineno', 'f_locals', 'f_trace'] | ||
if sys.version_info[:2] < (3, 0): |
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.
Would have been good to get a chance to review this, surely no need to merge it immediately?
Would it not have been better to use if PY2
from compat
? That's surely what compat
is there for.
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.
You are right, I completely forgot about compat. I'll fix that and work also on a test about it too as you suggested.
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.
done, see #729
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.
Sorry about that, was in a hurry. Thanks for the improvements.
Also (and arguably the first step in fixing this) we should have a test that the error raised is indeed |
The signal handler request_force_stop_sigrtmin (introduced with the heroku specific worker, #715) would fail in python3 because it was trying to read frame properties that have been removed in python3.
We now handle python2 as a special case with more frame properties.
Also fixed some warnings about using the war function of the logger