10000 bpo-44252: Correctly implement gc support for SSLError objects by pablogsal · Pull Request #26439 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 1 commit into from
May 28, 2021

Conversation

pablogsal
Copy link
Member
@pablogsal pablogsal commented May 28, 2021

Copy link
Member
@vstinner vstinner left a 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

Copy link
Member
@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@pablogsal pablogsal merged commit 8b4312b into python:main May 28, 2021
@pablogsal pablogsal deleted the bpo-44252 branch May 28, 2021 23:29
@miss-islington
Copy link
Contributor

Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 28, 2021
…nGH-26439)

(cherry picked from commit 8b4312b)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label May 28, 2021
@bedevere-bot
Copy link

GH-26441 is a backport of this pull request to the 3.10 branch.

pablogsal added a commit that referenced this pull request May 28, 2021
) (GH-26441)

(cherry picked from commit 8b4312b)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
@erlend-aasland
Copy link
Contributor

Thanks for fixing this, Pablo! Sorry for introducing the regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0