Title: `getpass`'s `echo_char` should not affect keyboard shortcuts · Issue #138577 · python/cpython · GitHub
Open Graph Title: `getpass`'s `echo_char` should not affect keyboard shortcuts · Issue #138577 · python/cpython
X Title: `getpass`'s `echo_char` should not affect keyboard shortcuts · Issue #138577 · python/cpython
Description: Bug report Bug description: Hitting Ctrl+U should clear the line but this is badly handled when echo_char is given: >>> getpass.getpass() Password: 'bar' >>> getpass.getpass(echo_char="*") Password: ******* 'foo\x15bar' See #138514 (comm...
Open Graph Description: Bug report Bug description: Hitting Ctrl+U should clear the line but this is badly handled when echo_char is given: >>> getpass.getpass() Password: 'bar' >>> getpass.getpass(echo_char="*") Password...
X Description: Bug report Bug description: Hitting Ctrl+U should clear the line but this is badly handled when echo_char is given: >>> getpass.getpass() Password: 'bar' >>> getpass.getpa...
Opengraph URL: https://github.com/python/cpython/issues/138577
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`getpass`'s `echo_char` should not affect keyboard shortcuts","articleBody":"# Bug report\n\n### Bug description:\n\nHitting `Ctrl+U` should clear the line but this is badly handled when `echo_char` is given:\n\n```py\n\u003e\u003e\u003e getpass.getpass()\nPassword: \n'bar'\n\u003e\u003e\u003e getpass.getpass(echo_char=\"*\")\nPassword: *******\n'foo\\x15bar'\n```\n\nSee https://github.com/python/cpython/issues/138514#issuecomment-3258630239.\n\nThis issue stems from the fact that we switch to non-canonical mode (https://www.man7.org/linux/man-pages/man3/termios.3.html). The rationale is that in canonical mode, we only have a line-by-line feedback (so we would see the characters only when we hit ENTER, which is not really useful...)\n\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-138677\n* gh-138696\n* gh-141597\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/picnixz","@type":"Person","name":"picnixz"},"datePublished":"2025-09-06T10:27:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/138577/cpython/issues/138577"}
| 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:95f6e1fb-5d9a-541c-fde1-d97d5e2d1e9d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C13A:3ADF04:5F9FBD:84854C:6A50744A |
| html-safe-nonce | 0d2a23599041dfcf4a8b9509143823785341a9c93ece1ca088f0ee5812b38c36 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTNBOjNBREYwNDo1RjlGQkQ6ODQ4NTRDOjZBNTA3NDRBIiwidmlzaXRvcl9pZCI6IjQwNjg0NzI1NjI1MDEzMTc3MDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 305787e948507775b6f24f741cac8589efd020f6574832bd566f538dd29a525b |
| hovercard-subject-tag | issue:3389873441 |
| 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/138577/issue_layout |
| twitter:image | https://opengraph.githubassets.com/31990e572f5fbe799a71382af1c668b3c6b90d7b705c0025bff012dcb669c408/python/cpython/issues/138577 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/31990e572f5fbe799a71382af1c668b3c6b90d7b705c0025bff012dcb669c408/python/cpython/issues/138577 |
| og:image:alt | Bug report Bug description: Hitting Ctrl+U should clear the line but this is badly handled when echo_char is given: >>> getpass.getpass() Password: 'bar' >>> getpass.getpass(echo_char="*") Password... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | picnixz |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| 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 | 7ac0ad2f2c7e4b9056617355fd9e33e22b0c8df9 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width