Title: co_instrumentation and co_monitoring Unexpectedly Set · Issue #133524 · python/cpython · GitHub
Open Graph Title: co_instrumentation and co_monitoring Unexpectedly Set · Issue #133524 · python/cpython
X Title: co_instrumentation and co_monitoring Unexpectedly Set · Issue #133524 · python/cpython
Description: Bug report Bug description: I ran into the following problematic case with gh-133221 (which had to be reverted): import sys import _testinternalcapi def foo(): pass def trace_temporarily(): sys._getframe().f_trace_opcodes = True sys.sett...
Open Graph Description: Bug report Bug description: I ran into the following problematic case with gh-133221 (which had to be reverted): import sys import _testinternalcapi def foo(): pass def trace_temporarily(): sys._ge...
X Description: Bug report Bug description: I ran into the following problematic case with gh-133221 (which had to be reverted): import sys import _testinternalcapi def foo(): pass def trace_temporarily(): sys._ge...
Opengraph URL: https://github.com/python/cpython/issues/133524
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"co_instrumentation and co_monitoring Unexpectedly Set","articleBody":"# Bug report\n\n### Bug description:\n\nI ran into the following problematic case with gh-133221 (which had to be reverted):\n\n```python\nimport sys\nimport _testinternalcapi\n\ndef foo():\n pass\n\ndef trace_temporarily():\n sys._getframe().f_trace_opcodes = True\n sys.settrace(print)\n sys.settrace(None)\n sys._getframe().f_trace_opcodes = False\ntrace_temporarily()\n\n_testinternalcapi.verify_stateless_code(foo.__code__)\nfoo()\n_testinternalcapi.verify_stateless_code(foo.__code__) # fails\n```\n\n(See https://github.com/python/cpython/pull/133221#issuecomment-2853467104.)\n\nI would expect `co_instrumentation` and `co_monitoring` to have remained NULL.\n\nCC @markshannon \n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\n_No response_","author":{"url":"https://github.com/ericsnowcurrently","@type":"Person","name":"ericsnowcurrently"},"datePublished":"2025-05-06T15:26:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/133524/cpython/issues/133524"}
| 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:0684f3dc-08bf-1f4b-6cad-b00980221e1a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B596:12343F:155CD5E:1C74D6F:696ADD57 |
| html-safe-nonce | 32a2c44cef6f272191895a9476ac372c1b70422d46d4d1990612890e3fc90443 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTk2OjEyMzQzRjoxNTVDRDVFOjFDNzRENkY6Njk2QURENTciLCJ2aXNpdG9yX2lkIjoiODczNDU0NDkxODU1OTI1MTc5OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | de52237d120f3cd06727b0cc4b52f9d7532cd855541a6933ff39ddd5be53a4cc |
| hovercard-subject-tag | issue:3043215377 |
| 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/133524/issue_layout |
| twitter:image | https://opengraph.githubassets.com/99f0841a9f66ddd5d4b16bfa318270ac26ded0f722bacc3d90069dc35a7fe5ec/python/cpython/issues/133524 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/99f0841a9f66ddd5d4b16bfa318270ac26ded0f722bacc3d90069dc35a7fe5ec/python/cpython/issues/133524 |
| og:image:alt | Bug report Bug description: I ran into the following problematic case with gh-133221 (which had to be reverted): import sys import _testinternalcapi def foo(): pass def trace_temporarily(): sys._ge... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ericsnowcurrently |
| 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 | 524a93f2c1f36522a3b4be4c110467ee4172245d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width