Title: ctypes: Remove misleading comment about tuple support in _as_parameter_ and add regression test · Issue #142174 · python/cpython · GitHub
Open Graph Title: ctypes: Remove misleading comment about tuple support in _as_parameter_ and add regression test · Issue #142174 · python/cpython
X Title: ctypes: Remove misleading comment about tuple support in _as_parameter_ and add regression test · Issue #142174 · python/cpython
Description: Bug report Bug description: Modules/_ctypes/callproc.c contained a comment (marked XXX) stating that as_parameter allows constructing arbitrary tuples and passing them, describing this convention as "dangerous". Analysis confirms that ct...
Open Graph Description: Bug report Bug description: Modules/_ctypes/callproc.c contained a comment (marked XXX) stating that as_parameter allows constructing arbitrary tuples and passing them, describing this convention a...
X Description: Bug report Bug description: Modules/_ctypes/callproc.c contained a comment (marked XXX) stating that as_parameter allows constructing arbitrary tuples and passing them, describing this convention a...
Opengraph URL: https://github.com/python/cpython/issues/142174
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ctypes: Remove misleading comment about tuple support in _as_parameter_ and add regression test","articleBody":"# Bug report\n\n### Bug description:\n\n\n`Modules/_ctypes/callproc.c` contained a comment (marked XXX) stating that as_parameter\n allows constructing arbitrary tuples and passing them, describing this convention as \"dangerous\".\nAnalysis confirms that \n`ctypes` \n does not support returning tuples from as_parameter for default conversions. Attempting to do so raises a \"TypeError\" (wrapped in an ArgumentError), meaning the described security risk does not exist in the current codebase.\n\n\n### CPython versions tested on:\n\n3.13\n\n### Operating systems tested on:\n\nmacOS\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-142175\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/CodeMaverick-143","@type":"Person","name":"CodeMaverick-143"},"datePublished":"2025-12-02T06:32:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/142174/cpython/issues/142174"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a6584de8-2a4d-bbc4-b699-83ec1752e91e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8D74:3C782D:28550C:33E1E4:696B8049 |
| html-safe-nonce | 94995a52af6f4dd357bdc7f80e06d0586738e7e3f0d8692077c8583a2d8bebbc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDc0OjNDNzgyRDoyODU1MEM6MzNFMUU0OjY5NkI4MDQ5IiwidmlzaXRvcl9pZCI6IjMzNDUyNDAzNjA5MjgxMTY4MDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 58dea1bcb3e7e9e7aefae48df33e2495c31bda09b152ef3b46a985ac25e17a75 |
| hovercard-subject-tag | issue:3684289638 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python/cpython/142174/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d71c72bb8f521f7f8f2ad9557a1cf20fd0ad702a40924be95dd5bad5cae6233b/python/cpython/issues/142174 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d71c72bb8f521f7f8f2ad9557a1cf20fd0ad702a40924be95dd5bad5cae6233b/python/cpython/issues/142174 |
| og:image:alt | Bug report Bug description: Modules/_ctypes/callproc.c contained a comment (marked XXX) stating that as_parameter allows constructing arbitrary tuples and passing them, describing this convention a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | CodeMaverick-143 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width