Title: gh-102980: Redirect pdb `interact` command, add tests and improve docs by gaogaotiantian · Pull Request #111194 · python/cpython · GitHub
Open Graph Title: gh-102980: Redirect pdb `interact` command, add tests and improve docs by gaogaotiantian · Pull Request #111194 · python/cpython
X Title: gh-102980: Redirect pdb `interact` command, add tests and improve docs by gaogaotiantian · Pull Request #111194 · python/cpython
Description: With the long due #102896, we can finally add tests for interact command. However, the current interact command uses code.interact directly which makes it super difficult to test, because code.interact writes to sys.stderr directly (with sys.stderr.write)! We need to overload the write method in a derived class to write to the same channel as Pdb.message. The interactive message is also changed to make more sense - one might wonder if this is a breaking change to users, but This PR will be not backported, so it's a new thing. The current status (plus the interactive issue in #102896 before the fix) made it almost impossible to write tests for interact command, so I don't think we'll break anything. This PR adds the class for interact commmand and some basic tests for interact; and also clarifies the namespace situation with interact - it's a bit tricky and could be confusing to the users, so some clarification is needed. The way to exit interact command is also added to the docs. Issue: gh-102980 📚 Documentation preview 📚: https://cpython-previews--111194.org.readthedocs.build/
Open Graph Description: With the long due #102896, we can finally add tests for interact command. However, the current interact command uses code.interact directly which makes it super difficult to test, because code.inte...
X Description: With the long due #102896, we can finally add tests for interact command. However, the current interact command uses code.interact directly which makes it super difficult to test, because code.inte...
Opengraph URL: https://github.com/python/cpython/pull/111194
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:36ae58d1-f650-4f37-804b-62afcaa46f60 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | C794:30C15B:14850C:1BB767:696A9BFE |
| html-safe-nonce | 4b5f335720a9122bb25728c5ed16e172260c2df8e3aee9bf7815385739afcdd7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzk0OjMwQzE1QjoxNDg1MEM6MUJCNzY3OjY5NkE5QkZFIiwidmlzaXRvcl9pZCI6IjU5MTExNTM0NDEwMjk5MjE3OTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ea065693938d8895900ee3bd30bb7835ae8deb93906f0b6ec605bda87b0656b0 |
| hovercard-subject-tag | pull_request:1568256475 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/111194/checks |
| twitter:image | https://avatars.githubusercontent.com/u/13121107?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/13121107?s=400&v=4 |
| og:image:alt | With the long due #102896, we can finally add tests for interact command. However, the current interact command uses code.interact directly which makes it super difficult to test, because code.inte... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | c0d8175e41e0e55b9e984c935b24b808cabab919dd3174aa45dac3ef503ed1af |
| 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 full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 99aab454e5ddc8df30805fb76c114c3008a15842 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width