-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-44252: Correctly implement gc support for SSLError objects #26439
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
Conversation
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'm not sure that the unit test is useful. If you want to keep it, maybe add a comment.
Using the following change, I can reproduce https://bugs.python.org/issue44252
diff --git a/Lib/site.py b/Lib/site.py
index 939893eb5e..c02987e220 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -672,3 +672,5 @@ def exists(path):
if __name__ == '__main__':
_script()
+
+import gc; gc.set_threshold(5)
Without this PR:
$ ./python -m test test_ssl -m test_ssl_cert_verify_error -v
...
Fatal Python error: Segmentation fault
Current thread 0x00007f25b0858640 (most recent call first):
File "/home/vstinner/python/3.10/Lib/traceback.py", line 132 in format_exception
File "/home/vstinner/python/3.10/Lib/test/test_ssl.py", line 262 in handle_error
File "/home/vstinner/python/3.10/Lib/test/test_ssl.py", line 2401 in wrap_conn
...
With this PR:
$ ./python -m test test_ssl -v
(...)
Tests result: SUCCESS
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.
Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
…nGH-26439) (cherry picked from commit 8b4312b) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
GH-26441 is a backport of this pull request to the 3.10 branch. |
Thanks for fixing this, Pablo! Sorry for introducing the regression. |
https://bugs.python.org/issue44252