Title: Unify the handling of `KeyboardInterrupt` in new REPLs · Issue #129628 · python/cpython · GitHub
Open Graph Title: Unify the handling of `KeyboardInterrupt` in new REPLs · Issue #129628 · python/cpython
X Title: Unify the handling of `KeyboardInterrupt` in new REPLs · Issue #129628 · python/cpython
Description: Feature or enhancement Proposal: It's a little confusing now. ❯ python -m asyncio asyncio REPL 3.14.0a4+ (heads/main:7d275611f62, Jan 27 2025, 05:41:56) [GCC 11.4.0] on linux Use "await" directly instead of "asyncio.run()". Type "help", ...
Open Graph Description: Feature or enhancement Proposal: It's a little confusing now. ❯ python -m asyncio asyncio REPL 3.14.0a4+ (heads/main:7d275611f62, Jan 27 2025, 05:41:56) [GCC 11.4.0] on linux Use "await" directly i...
X Description: Feature or enhancement Proposal: It's a little confusing now. ❯ python -m asyncio asyncio REPL 3.14.0a4+ (heads/main:7d275611f62, Jan 27 2025, 05:41:56) [GCC 11.4.0] on linux Use "await&qu...
Opengraph URL: https://github.com/python/cpython/issues/129628
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unify the handling of `KeyboardInterrupt` in new REPLs","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nIt's a little confusing now.\n\n```pycon\n❯ python -m asyncio\nasyncio REPL 3.14.0a4+ (heads/main:7d275611f62, Jan 27 2025, 05:41:56) [GCC 11.4.0] on linux\nUse \"await\" directly instead of \"asyncio.run()\".\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e import asyncio\n\u003e\u003e\u003e raise KeyboardInterrupt\n\nKeyboardInterrupt\n\u003e\u003e\u003e \n```\n\n```pycon\n❯ python\nPython 3.14.0a4+ (heads/main:7d275611f62, Jan 27 2025, 05:41:56) [GCC 11.4.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e raise KeyboardInterrupt\nTraceback (most recent call last):\n File \"\u003cpython-input-0\u003e\", line 1, in \u003cmodule\u003e\n raise KeyboardInterrupt\nKeyboardInterrupt\n\u003e\u003e\u003e \n```\n\nTwo options here:\n1. Remove specialcasing of `KeyboardInterrupt` in the asyncio REPL\n https://github.com/python/cpython/blob/bb5c6875d6e84bf2b4e134ed482141a51d223f09/Lib/asyncio/__main__.py#L73-L77\n\n2. Specialcase `KeyboardInterrupt` in the main REPL too, as is in the asyncio REPL\n\nWhat would you opt for?\n\nMe personally -- 1 (show traceback).\n\nCC @ambv \n\n### Has this already been discussed elsewhere?\n\nThis is a minor feature, which does not need previous discussion elsewhere\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-129636\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/johnslavik","@type":"Person","name":"johnslavik"},"datePublished":"2025-02-04T01:09:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/129628/cpython/issues/129628"}
| 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:4c3333f5-ed47-9dc9-f126-d190bd111c81 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E6A0:1BECEB:677AB1:879D45:6A530691 |
| html-safe-nonce | 9ccb1595a2587165679008bc13e9211d0e49d2fff288c87d1d1e8dccce5c9960 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNkEwOjFCRUNFQjo2NzdBQjE6ODc5RDQ1OjZBNTMwNjkxIiwidmlzaXRvcl9pZCI6IjY5MTU5MzI5NzIzMzMwNzQwNjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9f01d2f3fa0c68339074ce368d769c03725b07df3535bfbc2edaf07ac2fd7639 |
| hovercard-subject-tag | issue:2828887424 |
| 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/129628/issue_layout |
| twitter:image | https://opengraph.githubassets.com/283f9fb303fd5629cc25ab5947fb67eab18cb5982bbeb6b8a00b27621e1def21/python/cpython/issues/129628 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/283f9fb303fd5629cc25ab5947fb67eab18cb5982bbeb6b8a00b27621e1def21/python/cpython/issues/129628 |
| og:image:alt | Feature or enhancement Proposal: It's a little confusing now. ❯ python -m asyncio asyncio REPL 3.14.0a4+ (heads/main:7d275611f62, Jan 27 2025, 05:41:56) [GCC 11.4.0] on linux Use "await" directly i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | johnslavik |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width