Title: input() is blocking exceptions at some phase during execution · Issue #112585 · python/cpython · GitHub
Open Graph Title: input() is blocking exceptions at some phase during execution · Issue #112585 · python/cpython
X Title: input() is blocking exceptions at some phase during execution · Issue #112585 · python/cpython
Description: Bug report Bug description: The following loop will soon stuck at some value, due to some phase of built-in input() itself is blocking exceptions and will not pass the exception to upper scope until an ENTER is hit on keyboard. import os...
Open Graph Description: Bug report Bug description: The following loop will soon stuck at some value, due to some phase of built-in input() itself is blocking exceptions and will not pass the exception to upper scope unti...
X Description: Bug report Bug description: The following loop will soon stuck at some value, due to some phase of built-in input() itself is blocking exceptions and will not pass the exception to upper scope unti...
Opengraph URL: https://github.com/python/cpython/issues/112585
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"input() is blocking exceptions at some phase during execution","articleBody":"# Bug report\n\n### Bug description:\n\nThe following loop will soon stuck at some value, due to some phase of built-in input() itself is blocking exceptions and will not pass the exception to upper scope until an ENTER is hit on keyboard.\n```python\nimport os, signal, threading\n\ncnt = [0]\n\ndef interrupter(cnt):\n\tlocal_cnt = 0\n\twhile 1:\n\t\tif local_cnt != cnt[0]:\n\t\t\tlocal_cnt = cnt[0]\n\t\t\tos.kill(os.getpid(), signal.SIGINT)\n\nthreading.Thread(target=interrupter, args=(cnt,), daemon=True).start()\n\nwhile 1:\n\tcnt[0] += 1\n\ttry:\n\t\tinput(\"\u003e\")\n\texcept KeyboardInterrupt:\n\t\tprint(cnt[0])\n```\n\n\n### CPython versions tested on:\n\n3.8\n\n### Operating systems tested on:\n\nmacOS","author":{"url":"https://github.com/wh-timme","@type":"Person","name":"wh-timme"},"datePublished":"2023-12-01T12:13:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/112585/cpython/issues/112585"}
| 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:1e77ed4b-eaf7-6a36-0a94-725fc16a427f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D298:2EC166:AD95A:ECDEC:6A568512 |
| html-safe-nonce | eae9cb9cdce39d03a0736d89f228d883f88817e99a4caa4349be530e4f5ce974 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjk4OjJFQzE2NjpBRDk1QTpFQ0RFQzo2QTU2ODUxMiIsInZpc2l0b3JfaWQiOiI2NjY0NTY4MjA3NDQ4NjM4NzM4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | cc54a286d0a5979aede3c79b78e0f9b9325fd127cc99f113944bf9e4f295f6fc |
| hovercard-subject-tag | issue:2020766202 |
| 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/112585/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8d964775d8ed9fa01f6e7adab2399863ace46cf7302df757f0e557712697c4d5/python/cpython/issues/112585 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8d964775d8ed9fa01f6e7adab2399863ace46cf7302df757f0e557712697c4d5/python/cpython/issues/112585 |
| og:image:alt | Bug report Bug description: The following loop will soon stuck at some value, due to some phase of built-in input() itself is blocking exceptions and will not pass the exception to upper scope unti... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | wh-timme |
| hostname | github.com |
| expected-hostname | github.com |
| None | 19b5ee9431dcfce15ab4b001d626e4e3a6ba1acb7be814813a52bbebd9a86ef5 |
| 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 | fc131753d059926755b1ab26f13a2c96a692f5d7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width