Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-140795: Remove 'exc' field in SSLObject#143491
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
colesbury commented Jan 6, 2026 • edited by bedevere-app bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by bedevere-app bot
Uh oh!
There was an error while loading. Please reload this page.
The 'exc' field was used by our debug SSL callbacks. Keep the exception in the normal per-thread state to avoid shared mutable state between threads. This also avoids a reference count leak if the Python callback raised an exception because it can be called multiple times per SSL operation.
colesbury commented Jan 6, 2026
This is like: But for the |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
bedevere-bot commented Jan 8, 2026
🤖 New build scheduled with the buildbot fleet by @colesbury for commit 8cd4d98 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F143491%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
vstinner left a comment
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, but I would feel safer with proposed assertions to check that assumptions remain valid in the future if the code is modified.
| } | ||
| Py_RETURN_NONE; | ||
| error: | ||
| Py_XDECREF(sock); |
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 might add: assert(exc == NULL);.
| } | ||
| return PyLong_FromSize_t(count); | ||
| error: | ||
| Py_XDECREF(sock); |
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 might add: assert(exc == NULL);.
Modules/_ssl.c Outdated
| int retval; | ||
| int sockstate; | ||
| _PySSLError err; | ||
| PyObject *exc; |
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.
For consistency with other functions:
| PyObject*exc; | |
| PyObject*exc=NULL; |
| @@ -3002,7 +3012,6 @@ _ssl__SSLSocket_read_impl(PySSLSocket *self, Py_ssize_t len, | |||
| } | |||
| error: | |||
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 might add: assert(exc == NULL); here and in the done: label.
| @@ -3126,7 +3144,6 @@ _ssl__SSLSocket_shutdown_impl(PySSLSocket *self) | |||
| error: | |||
| Py_XDECREF(sock); | |||
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 might add: assert(exc == NULL);.
vstinner commented Jan 9, 2026
The 4 failed builbots are unrelated to this change. Windows buildbots failed to download zlib external dependency:
Android buildbot: test_urllibnet failed with: |
7d155d7 into python:mainUh oh!
There was an error while loading. Please reload this page.
The 'exc' field was used by our debug SSL callbacks. Keep the exception in the normal per-thread state to avoid shared mutable state between threads. This also avoids a reference count leak if the Python callback raised an exception because it can be called multiple times per SSL operation.
The 'exc' field was used by our debug SSL callbacks. Keep the exception in the normal per-thread state to avoid shared mutable state between threads.
This also avoids a reference count leak if the Python callback raised an exception because it can be called multiple times per SSL operation.