-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
8000 gh-100062: Remove error code tables from _ssl and err_names_to_codes #100063
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
…codes Prior to python#25300, the make_ssl_data.py script used various tables, exposed in _ssl, to update the error list. After that PR, this is no longer used. Moreover, the err_names_to_codes map isn't used at all. Clean those up. This gets them out of the way if, in the future, OpenSSL provides an API to do what the code here is doing directly. (openssl/openssl#19848)
✅ Deploy Preview for python-cpython-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
@@ -6165,7 +6153,6 @@ sslmodule_traverse(PyObject *m, visitproc visit, void *arg) | |||
Py_VISIT(state->PySSLSyscallErrorObject); | |||
Py_VISIT(state->PySSLEOFErrorObject); | |||
Py_VISIT(state->err_codes_to_names); | |||
Py_VISIT(state->err_names_to_codes); | |||
Py_VISIT(state->lib_codes_to_names); |
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.
I'm not very familiar with the CPython API, so I wasn't sure if this should be removed now that the objects are no longer exported. I noticed Sock_Type
doesn't seem to be exported, but is traversed, while str_library
is also unexported but not traversed.
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.
This is for cycle detection. Sock_Type
is a type object, which may contain references that could cause cycles, while I assume str_library
is a string, which can never participate in a cycle. So we visit the former but not the latter.
@tiran This PR look reasonable? Anything missing on my end? |
Adding the |
@jackjansen, @dstufft, @alex (as active ssl experts) |
This looks good to me, but I'm going to wait for a bit before merging in case one of the other maintainers know of a reason these were exposed. |
My (possibly wrong) guess is that were exposed for the older version of the make_ssl_data.py script. (See PR description.) |
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
@@ -6165,7 +6153,6 @@ sslmodule_traverse(PyObject *m, visitproc visit, void *arg) | |||
Py_VISIT(state->PySSLSyscallErrorObject); | |||
Py_VISIT(state->PySSLEOFErrorObject); | |||
Py_VISIT(state->err_codes_to_names); | |||
Py_VISIT(state->err_names_to_codes); | |||
Py_VISIT(state->lib_codes_to_names); |
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.
This is for cycle detection. Sock_Type
is a type object, which may contain references that could cause cycles, while I assume str_library
is a string, which can never participate in a cycle. So we visit the former but not the latter.
Let's merge this before the next alpha so there's more time for someone to shout if we shouldn't have dropped it. |
…codes (pythonGH-100063) Prior to python#25300, the make_ssl_data.py script used various tables, exposed in _ssl, to update the error list. After that PR, this is no longer used. Moreover, the err_names_to_codes map isn't used at all. Clean those up. This gets them out of the way if, in the future, OpenSSL provides an API to do what the code here is doing directly. (openssl/openssl#19848)
…codes (pythonGH-100063) Prior to python#25300, the make_ssl_data.py script used various tables, exposed in _ssl, to update the error list. After that PR, this is no longer used. Moreover, the err_names_to_codes map isn't used at all. Clean those up. This gets them out of the way if, in the future, OpenSSL provides an API to do what the code here is doing directly. (openssl/openssl#19848)
Prior to #25300, the make_ssl_data.py script used various tables, exposed in _ssl, to update the error list.
After that PR, this is no longer used. Moreover, the err_names_to_codes map isn't used at all. Clean those up. This gets them out of the way if, in the future, OpenSSL provides an API to do what the code here is doing directly. (openssl/openssl#19848)