Repository navigation
gh-160962: Fix PyInitConfig_SetStr() with NULL value - #161258
Conversation
Previously, passing NULL to an optional string option crashed. Add tests on PyInitConfig_GetInt(), PyInitConfig_GetStr() and PyInitConfig_GetStrList() functions.
NekoAsakura
left a comment
There was a problem hiding this comment.
The fix LGTM.
The tests would be better placed in test_initconfig_get_api(), which already covers the Get* functions. test_initconfig_api is currently skipped on every build (#161270).
Also, the PyInitConfig_SetStr() doc could say that NULL is accepted for optional string options, like PyInitConfig_GetStr() does (link).
Instead, add some tests to test_initconfig_get_api().
|
@NekoAsakura: Please review the updated PR.
Oh, you're right, I completely forgot about
Oops! I approved your PR.
Done: I updated SetStr() doc to mention NULL. I also documented optional strings as |
Documentation build overview
|
NekoAsakura
left a comment
There was a problem hiding this comment.
Thanks, LGTM. Just one comment.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
|
GH-161291 is a backport of this pull request to the 3.15 branch. |
|
GH-161292 is a backport of this pull request to the 3.14 branch. |
… (#161291) gh-160962: Fix PyInitConfig_SetStr() with NULL value (GH-161258) Previously, passing NULL to an optional string option crashed. Document optional string options. Add more tests on the PyInitConfig API. (cherry picked from commit 6d69297) Co-authored-by: Victor Stinner <vstinner@python.org>
… (#161292) gh-160962: Fix PyInitConfig_SetStr() with NULL value (GH-161258) Previously, passing NULL to an optional string option crashed. Document optional string options. Add more tests on the PyInitConfig API. (cherry picked from commit 6d69297) Co-authored-by: Victor Stinner <vstinner@python.org>
|
I merged my PR. Thanks @NekoAsakura for your accurate review! |
Previously, passing NULL to an optional string option crashed.
Add tests on PyInitConfig_GetInt(), PyInitConfig_GetStr() and PyInitConfig_GetStrList() functions.