Title: bpo-26868: Fix example usage of PyModule_AddObject. by brandtbucher · Pull Request #15725 · python/cpython · GitHub
Open Graph Title: bpo-26868: Fix example usage of PyModule_AddObject. by brandtbucher · Pull Request #15725 · python/cpython
X Title: bpo-26868: Fix example usage of PyModule_AddObject. by brandtbucher · Pull Request #15725 · python/cpython
Description: Unlike other APIs that steal references, PyModule_AddObject only does it on success. However, most calls throughout the codebase don't manually Py_DECREF on failure as required by the implementation, which leads contributors to believe that it is not necessary. This PR fixes example usage and adds a note on this behavior in the documentation only. There are over 200 bad calls throughout the codebase that are not addressed by this patch. Because there are so many bugs, fixing them all will likely require more care and likely several PRs (or a possible deprecation period and behavior change... it appears incorrect usage is actually more common than correct usage). I'm willing to do the work, but some direction on this would be nice. https://bugs.python.org/issue26868
Open Graph Description: Unlike other APIs that steal references, PyModule_AddObject only does it on success. However, most calls throughout the codebase don't manually Py_DECREF on failure as required by the implement...
X Description: Unlike other APIs that steal references, PyModule_AddObject only does it on success. However, most calls throughout the codebase don't manually Py_DECREF on failure as required by the imple...
Opengraph URL: https://github.com/python/cpython/pull/15725
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:01cd8076-b6e2-245d-41d1-4d5252686537 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8EC6:3367C0:4101F:5BDE6:6A548C9B |
| html-safe-nonce | e95fdf83483f0ab8b9acd74c461a70f0377b3bfc07349be2fd4e6f93af97ef4a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RUM2OjMzNjdDMDo0MTAxRjo1QkRFNjo2QTU0OEM5QiIsInZpc2l0b3JfaWQiOiI5MTk3MjE2NTY4Mjc0MzU3NDAzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 46e3c1761a1eb796f8e8521bcef73a5ae8a9de9e79cd4646e4f7d7de8b54f48e |
| hovercard-subject-tag | pull_request:315205555 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/15725/files |
| twitter:image | https://avatars.githubusercontent.com/u/40968415?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40968415?s=400&v=4 |
| og:image:alt | Unlike other APIs that steal references, PyModule_AddObject only does it on success. However, most calls throughout the codebase don't manually Py_DECREF on failure as required by the implement... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 03ccb116376fd46e8ba2a4cdc541e35f13f70734 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width