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
bpo-42021: Fix possible ref leaks during _sqlite3 module init #22673
Conversation
FYI, the Ubuntu CI fails while testing
|
Thanks for the work,
I left several reviews for better usage.
The reviews are based on the recommended usage of C API.
We can remove dict and related codes after the review is applied.
It is recommended extensions use other PyModule_*() and PyObject_*() functions rather than directly manipulate a module’s __dict__.
Misc/NEWS.d/next/Library/2020-10-12-21-21-24.bpo-42021.8yv_8-.rst
Outdated
Show resolved
Hide resolved
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase And if you don't make the requested changes, you will be put in the comfy chair! |
Thanks for reviewing @corona10! I'll have a look at it tonight. |
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
- Use PyModule_Add*() iso. directly manipulating the module's __dict__ - Fix return type mismatch - Ditch ADD_STRING (after cleaning up, there was no use for it) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
I have made the requested changes; please review again. |
Thanks for making the requested changes! @corona10: please review the changes made to this pull request. |
Thanks again for reviewing!
That's way better. I should've though of that, but I'm not that familiar with all the recommended practices of the C API yet. Thanks! By the way, regarding the integer constants loop between line 412 and 419. Wouldn't it be cleaner to use |
Regarding this snippet in the module init function:
This looks like something that should be deprecated. |
Thanks for making the requested changes! @corona10: please review the changes made to this pull request. |
@corona10: This snuck in in the last push (commit 70a42ab)! If you want me to exclude this, let me know, and I'll revert it right away. Sorry 'bout that. |
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
I have made the requested changes; please review again. |
Thanks for making the requested changes! @corona10: please review the changes made to this pull request. |
@erlend-aasland Thanks for the work, I also manually check the module attribute by my hand and it looks good. |
Great! Thanks for a thorough review, @corona10! |
Is python3.7 involved? |
@corona10, would you mind reviewing this?
https://bugs.python.org/issue42021