gh-111230: Fix _ssl.c not checking for errors when initializing a module#111232
gh-111230: Fix _ssl.c not checking for errors when initializing a module#111232erlend-aasland merged 6 commits into
_ssl.c not checking for errors when initializing a module#111232Conversation
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
serhiy-storchaka
left a comment
There was a problem hiding this comment.
LGTM, but I would prefer to not use ALL_CAPS for macro parameters (here, and in your other PRs). It is very unusual (and perhaps against PEP 7). Please only use ALL_CAPS for macro names.
Sorry, something went wrong.
|
@serhiy-storchaka I think that this is the style suggested and prefered by @erlend-aasland, I am ok with both. |
Sorry, something went wrong.
There is no mention of macro arguments in PEP-7; please do not spread uncertainty and doubt like this. I personally prefer ALL_CAPS macro parameters since it makes them stand out better from implicit variables that are not part of the macro "scope"; for example, many macros are used in extension module initialisation phase, and very often, the module object is implicitly used from within the macro. Using ALL_CAPS macro parameters makes it clear that these parameters are text strings (and not variables) that will be replaced by the pre-processor. Also, note that this style is used other places in the code base by other core devs. |
Sorry, something went wrong.
|
Thanks @sobolevn for the PR, and @erlend-aasland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, something went wrong.
|
Thanks @sobolevn for the PR, and @erlend-aasland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, something went wrong.
|
Sorry, @sobolevn and @erlend-aasland, I could not cleanly backport this to |
Sorry, something went wrong.
|
Sorry, @sobolevn and @erlend-aasland, I could not cleanly backport this to |
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot AMD64 FreeBSD14 3.x has failed when building commit f630494. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/1232/builds/358 Failed tests:
Summary of the results of the build (if available): == Click to see traceback logsremote: Enumerating objects: 16, done.
remote: Counting objects: 6% (1/16)
remote: Counting objects: 12% (2/16)
remote: Counting objects: 18% (3/16)
remote: Counting objects: 25% (4/16)
remote: Counting objects: 31% (5/16)
remote: Counting objects: 37% (6/16)
remote: Counting objects: 43% (7/16)
remote: Counting objects: 50% (8/16)
remote: Counting objects: 56% (9/16)
remote: Counting objects: 62% (10/16)
remote: Counting objects: 68% (11/16)
remote: Counting objects: 75% (12/16)
remote: Counting objects: 81% (13/16)
remote: Counting objects: 87% (14/16)
remote: Counting objects: 93% (15/16)
remote: Counting objects: 100% (16/16)
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 11% (1/9)
remote: Compressing objects: 22% (2/9)
remote: Compressing objects: 33% (3/9)
remote: Compressing objects: 44% (4/9)
remote: Compressing objects: 55% (5/9)
remote: Compressing objects: 66% (6/9)
remote: Compressing objects: 77% (7/9)
remote: Compressing objects: 88% (8/9)
remote: Compressing objects: 100% (9/9)
remote: Compressing objects: 100% (9/9), done.
remote: Total 9 (delta 7), reused 1 (delta 0), pack-reused 0
From https://github.com/python/cpython
* branch main -> FETCH_HEAD
Note: switching to 'f6304949bb9937e798ecac8b414606dc01bc6d3c'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at f6304949bb gh-111230: Fix errors checking in _ssl module init (#111232)
Switched to and reset branch 'main'
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly. |
Sorry, something went wrong.
|
Indeed, PEP 7 does not specify it explicitly. But all examples in PEP 7 and AFAIK all existing macros write parameter names in lower case. If some macros write it in upper case, it perhaps a new tendency, I never seen this before. I think that it should be specified in PEP 7 explicitly. |
Sorry, something went wrong.
|
I created a new discussion for this: https://discuss.python.org/t/all-caps-for-macro-parameter-names/37119. |
Sorry, something went wrong.
I agree.
Thanks! |
Sorry, something went wrong.
@sobolevn @erlend-aasland Does this still need backporting? If not, let's close #111230. |
Sorry, something went wrong.
Introduce ADD_INT_CONST macro wrapper for PyModule_AddIntConstant()
Introduce ADD_INT_CONST macro wrapper for PyModule_AddIntConstant()
I've used
_PyModule_ADD_INT_CONSTmacro name to make the diff minimal:PyModule_AddIntConstant_ssl.cdoes not handle errors on module creation #111230