Title: gh-151126: Add missing `PyErr_NoMemory` in `_winapi` module by sobolevn · Pull Request #151154 · python/cpython · GitHub
Open Graph Title: gh-151126: Add missing `PyErr_NoMemory` in `_winapi` module by sobolevn · Pull Request #151154 · python/cpython
X Title: gh-151126: Add missing `PyErr_NoMemory` in `_winapi` module by sobolevn · Pull Request #151154 · python/cpython
Description: This place misses it: cpython/Modules/_winapi.c Lines 1196 to 1198 in 9fdbade ret = PyMem_Malloc(*size); if (ret == NULL) goto cleanup; It is used as: attribute_list->handle_list = gethandlelist(value, "handle_list", &handle_list_size); if (attribute_list->handle_list == NULL && PyErr_Occurred()) { ret = -1; goto cleanup; } It would be rather strange to swallow MemoryError here. Before that we allow KeyError to pass silently and return early if this code path should not be taken: value = PyMapping_GetItemString(mapping, name); if (!value) { PyErr_Clear(); return NULL; } All other error paths in the same function set exceptions, except this if: cpython/Modules/_winapi.c Lines 1278 to 1282 in 9fdbade attribute_list->attribute_list = PyMem_Malloc(attribute_list_size); if (attribute_list->attribute_list == NULL) { ret = -1; goto cleanup; } Later this NULL is returned from _winapi.CreateProcess without an exception set. Issue: gh-151126
Open Graph Description: This place misses it: cpython/Modules/_winapi.c Lines 1196 to 1198 in 9fdbade ret = PyMem_Malloc(*size);...
X Description: This place misses it: cpython/Modules/_winapi.c Lines 1196 to 1198 in 9fdbade ret = PyMem_Malloc(*size);...
Opengraph URL: https://github.com/python/cpython/pull/151154
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:c3605fe0-a19c-4d82-9ae7-45563dc196ea |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9B9E:113CA7:3F5B65:540B6B:6A52FB64 |
| html-safe-nonce | ca1200665a629d2fc3b657df27192307c8b2d9564fc6b16e0e6c30dd75abcb02 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjlFOjExM0NBNzozRjVCNjU6NTQwQjZCOjZBNTJGQjY0IiwidmlzaXRvcl9pZCI6IjI4MTQ5NDI3NzE4MzU3NjM1NTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1a056630e8d9026ca39f773577142fdbe7546a3cad54fc7069b811fab0c6d480 |
| hovercard-subject-tag | pull_request:3831686652 |
| 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/151154/files |
| twitter:image | https://avatars.githubusercontent.com/u/4660275?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/4660275?s=400&v=4 |
| og:image:alt | This place misses it: cpython/Modules/_winapi.c Lines 1196 to 1198 in 9fdbade ret = PyMem_Malloc(*size);... |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width