Title: On current main (after applying PEP 669) the tracing behavior changed and can notify about the same line more than once. · Issue #103471 · python/cpython · GitHub
Open Graph Title: On current main (after applying PEP 669) the tracing behavior changed and can notify about the same line more than once. · Issue #103471 · python/cpython
X Title: On current main (after applying PEP 669) the tracing behavior changed and can notify about the same line more than once. · Issue #103471 · python/cpython
Description: The test case for this is below (it works for Python 3.11 and fails in the current master). import sys import unittest class TestSetLocalTrace(unittest.TestCase): def test_with_branches(self): def tracefunc(frame, event, arg): if frame.f...
Open Graph Description: The test case for this is below (it works for Python 3.11 and fails in the current master). import sys import unittest class TestSetLocalTrace(unittest.TestCase): def test_with_branches(self): def ...
X Description: The test case for this is below (it works for Python 3.11 and fails in the current master). import sys import unittest class TestSetLocalTrace(unittest.TestCase): def test_with_branches(self): def ...
Opengraph URL: https://github.com/python/cpython/issues/103471
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"On current main (after applying PEP 669) the tracing behavior changed and can notify about the same line more than once.","articleBody":"The test case for this is below (it works for Python 3.11 and fails in the current master).\r\n\r\n```\r\nimport sys\r\nimport unittest\r\n\r\n\r\nclass TestSetLocalTrace(unittest.TestCase):\r\n\r\n def test_with_branches(self):\r\n\r\n def tracefunc(frame, event, arg):\r\n if frame.f_code.co_name == \"func\":\r\n frame.f_trace = None\r\n frame.f_trace = tracefunc\r\n line = frame.f_lineno - frame.f_code.co_firstlineno\r\n events.append((line, event))\r\n return tracefunc\r\n\r\n def func(arg=1):\r\n N = 1\r\n if arg \u003e= 2:\r\n not_reached = 3\r\n else:\r\n reached = 5\r\n if arg \u003e= 3:\r\n not_reached = 7\r\n else:\r\n reached = 9\r\n the_end = 10\r\n\r\n EXPECTED_EVENTS = [\r\n (0, 'call'),\r\n (1, 'line'),\r\n (2, 'line'),\r\n (5, 'line'),\r\n (6, 'line'),\r\n (9, 'line'),\r\n (10, 'line'),\r\n (10, 'return'),\r\n ]\r\n\r\n events = []\r\n sys.settrace(tracefunc)\r\n sys._getframe().f_trace = tracefunc\r\n func()\r\n self.assertEqual(events, EXPECTED_EVENTS)\r\n sys.settrace(None)\r\n```","author":{"url":"https://github.com/fabioz","@type":"Person","name":"fabioz"},"datePublished":"2023-04-12T12:07:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/103471/cpython/issues/103471"}
| 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:f0fea20e-75c3-3615-0529-1b7ff35c966a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B40E:106A75:EA2131:149E4E7:696A26C2 |
| html-safe-nonce | affadc769cde7e8a96861b92d4569732d0e44f284ce640791b7515f5ade9da47 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDBFOjEwNkE3NTpFQTIxMzE6MTQ5RTRFNzo2OTZBMjZDMiIsInZpc2l0b3JfaWQiOiIxMTM3NzY5MDEyMDc4OTc4NzU0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | bf371809e2f4d3de196726ae7eb9141eaaf98c5acf3fc41ec76340654b91df45 |
| hovercard-subject-tag | issue:1664438251 |
| 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/103471/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3543943426a43f072c2cca73e969d7dd1fc8525d338cb6c88f68920d5407da1f/python/cpython/issues/103471 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3543943426a43f072c2cca73e969d7dd1fc8525d338cb6c88f68920d5407da1f/python/cpython/issues/103471 |
| og:image:alt | The test case for this is below (it works for Python 3.11 and fails in the current master). import sys import unittest class TestSetLocalTrace(unittest.TestCase): def test_with_branches(self): def ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fabioz |
| hostname | github.com |
| expected-hostname | github.com |
| None | a1022f03e4f0d91ea173e4e5dac892c982e0588c62f1ce56121d755a320a3569 |
| 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 | f472b8e6c7b3fdd5d0354972a3f4c516289bf0be |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width