Title: pdb: some expression results are printed to the debuggee stdout · Issue #143874 · python/cpython · GitHub
Open Graph Title: pdb: some expression results are printed to the debuggee stdout · Issue #143874 · python/cpython
X Title: pdb: some expression results are printed to the debuggee stdout · Issue #143874 · python/cpython
Description: Bug report Bug description: In a dual-terminal / remote debugging setup, some expressions evaluated in pdb print their results to the debuggee’s stdout instead of the pdb output stream. For example, at the pdb prompt: (lambda: 123)() sum...
Open Graph Description: Bug report Bug description: In a dual-terminal / remote debugging setup, some expressions evaluated in pdb print their results to the debuggee’s stdout instead of the pdb output stream. For example...
X Description: Bug report Bug description: In a dual-terminal / remote debugging setup, some expressions evaluated in pdb print their results to the debuggee’s stdout instead of the pdb output stream. For example...
Opengraph URL: https://github.com/python/cpython/issues/143874
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"pdb: some expression results are printed to the debuggee stdout","articleBody":"# Bug report\n\n### Bug description:\n\nIn a dual-terminal / remote debugging setup, some expressions evaluated in pdb print their results to the debuggee’s stdout instead of the pdb output stream. For example, at the pdb prompt:\n- `(lambda: 123)()`\n- `sum(i for i in (1, 2, 3))`\n\ntheir results appear in the remote/debuggee terminal. I have screenshots and a minimal test case demonstrating the issue.\n\n**target.py**\n``` py\n# target.py\nimport os\nimport time\n\nprint(\"TARGET PID:\", os.getpid(), flush=True)\nprint(\"Target is running... waiting forever.\", flush=True)\n\nwhile True:\n time.sleep(1)\n```\n\nattach.py\n``` py\n# attach.py\nimport sys\nimport pdb\n\npid = int(sys.argv[1])\nprint(\"Attaching to\", pid)\npdb.attach(pid)\n```\n\n\u003cimg width=\"2878\" height=\"1698\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/7d67a793-e8e7-46a4-a722-895dd074a91b\" /\u003e\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nWindows\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-143875\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/hyongtao-code","@type":"Person","name":"hyongtao-code"},"datePublished":"2026-01-15T15:53:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/143874/cpython/issues/143874"}
| 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:abfabd0a-f1ad-fe51-eb8a-05514c6a08ae |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9E30:BB9B6:13D1B2A:1B211EF:6969FEBC |
| html-safe-nonce | 3188e13d49e43f56f7295b96ab597b38fc310e4e969e69adf199ae1d5271b1bd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTMwOkJCOUI2OjEzRDFCMkE6MUIyMTFFRjo2OTY5RkVCQyIsInZpc2l0b3JfaWQiOiI0ODkxMjAwMzY1ODEwODEwNTU2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 084dd79d2d22cd5261a1731e1df90acb650876dca398156a1eb29cdc5992daee |
| hovercard-subject-tag | issue:3818126816 |
| 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/143874/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2eb91179f0204b70edd1488304651006f5a8882b5b3c93dd92afebb2cbc576ad/python/cpython/issues/143874 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2eb91179f0204b70edd1488304651006f5a8882b5b3c93dd92afebb2cbc576ad/python/cpython/issues/143874 |
| og:image:alt | Bug report Bug description: In a dual-terminal / remote debugging setup, some expressions evaluated in pdb print their results to the debuggee’s stdout instead of the pdb output stream. For example... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hyongtao-code |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| 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 | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width