Title: cmd.Cmd fails tab completion for lines beginning with `! ` (bang space) · Issue #133363 · python/cpython · GitHub
Open Graph Title: cmd.Cmd fails tab completion for lines beginning with `! ` (bang space) · Issue #133363 · python/cpython
X Title: cmd.Cmd fails tab completion for lines beginning with `! ` (bang space) · Issue #133363 · python/cpython
Description: Bug report Bug description: As noted in #133351 (comment) PDB allows commands that start with !, but Cmd fails to tab complete them if there's a space after the !, because it falls down this code path: cpython/Lib/cmd.py Lines 274 to 280...
Open Graph Description: Bug report Bug description: As noted in #133351 (comment) PDB allows commands that start with !, but Cmd fails to tab complete them if there's a space after the !, because it falls down this code p...
X Description: Bug report Bug description: As noted in #133351 (comment) PDB allows commands that start with !, but Cmd fails to tab complete them if there's a space after the !, because it falls down this co...
Opengraph URL: https://github.com/python/cpython/issues/133363
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"cmd.Cmd fails tab completion for lines beginning with `! ` (bang space)","articleBody":"# Bug report\n\n### Bug description:\n\nAs noted in https://github.com/python/cpython/issues/133351#issuecomment-2848895066 PDB allows commands that start with `!`, but Cmd fails to tab complete them if there's a space after the `!`, because it falls down this code path:\n\nhttps://github.com/python/cpython/blob/2bc836523105a2197a1f987cc03911bece74b35e/Lib/cmd.py#L274-L280\n\nwhich expects `cmd` to always be a string, but `parsecmd` is returning `None` instead when the line starts with `!` and `do_shell` is not defined.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-133364\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/godlygeek","@type":"Person","name":"godlygeek"},"datePublished":"2025-05-04T01:51:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/133363/cpython/issues/133363"}
| 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:f791c02d-6073-e1e9-e5e7-337847179b9a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D7A2:2603AD:49BA97:6132D1:696B3FC1 |
| html-safe-nonce | 54952505f940128492d3e70c7994ba697cc985c5f006d392707bcd952a52d51b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEN0EyOjI2MDNBRDo0OUJBOTc6NjEzMkQxOjY5NkIzRkMxIiwidmlzaXRvcl9pZCI6IjQ1MTE1MTQ0MTA3ODk5MjgzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 61ec3f86893f2130d3e4b713d5c7722de84619f339a174d8bf2e189ee2519f87 |
| hovercard-subject-tag | issue:3037715839 |
| 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/133363/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8c0cb397ee7dd25c83c792c7902644726cde7d258ee6970cccc4d820601b05df/python/cpython/issues/133363 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8c0cb397ee7dd25c83c792c7902644726cde7d258ee6970cccc4d820601b05df/python/cpython/issues/133363 |
| og:image:alt | Bug report Bug description: As noted in #133351 (comment) PDB allows commands that start with !, but Cmd fails to tab complete them if there's a space after the !, because it falls down this code p... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | godlygeek |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| 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 | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width