Title: input() doesn't print the prompt if stderr is redirected · Issue #92715 · python/cpython · GitHub
Open Graph Title: input() doesn't print the prompt if stderr is redirected · Issue #92715 · python/cpython
X Title: input() doesn't print the prompt if stderr is redirected · Issue #92715 · python/cpython
Description: Bug report If stderr is redirected, input() doesn't print the prompt. The same happens when stdout is redirected, but that is to be expected. Code (in test.py): x = input('prompt: ') print(x) When run: > python test.py prompt: text text ...
Open Graph Description: Bug report If stderr is redirected, input() doesn't print the prompt. The same happens when stdout is redirected, but that is to be expected. Code (in test.py): x = input('prompt: ') print(x) When ...
X Description: Bug report If stderr is redirected, input() doesn't print the prompt. The same happens when stdout is redirected, but that is to be expected. Code (in test.py): x = input('prompt: ') pr...
Opengraph URL: https://github.com/python/cpython/issues/92715
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"input() doesn't print the prompt if stderr is redirected","articleBody":"**Bug report**\r\n\r\nIf `stderr` is redirected, `input()` doesn't print the prompt. The same happens when `stdout` is redirected, but that is to be expected.\r\n\r\nCode (in `test.py`):\r\n```Python\r\nx = input('prompt: ')\r\nprint(x)\r\n```\r\n\r\nWhen run:\r\n``` \r\n\u003e python test.py\r\nprompt: text\r\ntext\r\n\r\n\u003e python test.py \u003eout\r\ntext\r\n\r\n\u003e python test.py 2\u003eerr\r\ntext\r\ntext\r\n```\r\nThe contents of `out` and `err`, respectively:\r\n```\r\n# out\r\nprompt: text\r\n# err\r\nprompt: \r\n```\r\nThe first and second cases are as expected. In the last case, the prompt is not printed, even though it should go into `stdout`, according to the [documentation](https://docs.python.org/3/library/functions.html#input). Instead, it is printed to `err`.\r\n\r\n**Your environment**\r\n\r\n- CPython versions tested on: 3.9.2\r\n- Operating system and architecture: Linux 5.11.0-40-generic #44~20.04.2-Ubuntu SMP Tue Oct 26 18:07:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux","author":{"url":"https://github.com/DavidNemeskey","@type":"Person","name":"DavidNemeskey"},"datePublished":"2022-05-12T07:52:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/92715/cpython/issues/92715"}
| 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:021147ff-54e4-88cd-6705-4e55b158879c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E18E:3FFE1:F35769:14B6609:6969F343 |
| html-safe-nonce | 2d2db7156f4ca9ab8925c9875b781a433f007e05c8371d525059975f6f88d4d9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMThFOjNGRkUxOkYzNTc2OToxNEI2NjA5OjY5NjlGMzQzIiwidmlzaXRvcl9pZCI6IjE4Mzg2MDMzMDcwODA4NzI3NzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d4b5ea3fefd19945de973d978d6ec13d7053acb9f9b9379e79e9c14aff54ea1c |
| hovercard-subject-tag | issue:1233588555 |
| 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/92715/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1a4a560a23d8ec567b21c065cb4d3bf1c31482548eca504265f56a80f7e75953/python/cpython/issues/92715 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1a4a560a23d8ec567b21c065cb4d3bf1c31482548eca504265f56a80f7e75953/python/cpython/issues/92715 |
| og:image:alt | Bug report If stderr is redirected, input() doesn't print the prompt. The same happens when stdout is redirected, but that is to be expected. Code (in test.py): x = input('prompt: ') print(x) When ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DavidNemeskey |
| 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