Title: Wrong output example on invalid options documentation · Issue #130750 · python/cpython · GitHub
Open Graph Title: Wrong output example on invalid options documentation · Issue #130750 · python/cpython
X Title: Wrong output example on invalid options documentation · Issue #130750 · python/cpython
Description: In the current documentation on the error message when invalid args are passed states that the available choices are single-quoted, but they actually aren't, both according to argparse's code and its tests (here and here). Also, the optp...
Open Graph Description: In the current documentation on the error message when invalid args are passed states that the available choices are single-quoted, but they actually aren't, both according to argparse's code and i...
X Description: In the current documentation on the error message when invalid args are passed states that the available choices are single-quoted, but they actually aren't, both according to argparse's co...
Opengraph URL: https://github.com/python/cpython/issues/130750
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Wrong output example on invalid options documentation","articleBody":"In the current documentation on the error message when invalid args are passed states that the available choices are single-quoted, but they actually aren't, both according to [argparse's code](https://github.com/python/cpython/blob/c9932a9ec8a3077933a85101aae9c3ac155e6d04/Lib/argparse.py#L2587) and its tests ([here](https://github.com/python/cpython/blob/c9932a9ec8a3077933a85101aae9c3ac155e6d04/Lib/test/test_argparse.py#L1020) and [here](https://github.com/python/cpython/blob/c9932a9ec8a3077933a85101aae9c3ac155e6d04/Lib/test/test_argparse.py#L2288)).\n\nAlso, the [optparse](https://github.com/python/cpython/blob/c9932a9ec8a3077933a85101aae9c3ac155e6d04/Lib/optparse.py#L431) ([test](https://github.com/python/cpython/blob/c9932a9ec8a3077933a85101aae9c3ac155e6d04/Lib/test/test_optparse.py#L828)) error message does include single quotes. They should probably both have the same error format.\n\nI am reporting this following a PR I made to fix a failing test in the deal library: https://github.com/life4/deal/pull/138\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-130751\n* gh-144983\n* gh-149385\n* gh-149386\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/TheDSCPL","@type":"Person","name":"TheDSCPL"},"datePublished":"2025-03-02T00:23:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/130750/cpython/issues/130750"}
| 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:0c118f9d-15a8-80d6-142b-0cb7b5e361fa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D920:8A2B5:3B06C9:4FBF3B:6A4EB5EF |
| html-safe-nonce | 4860b54e3fc51681e0187d63c37bc86bf6ba08cf7b930a7828a1b7bb313bbc18 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTIwOjhBMkI1OjNCMDZDOTo0RkJGM0I6NkE0RUI1RUYiLCJ2aXNpdG9yX2lkIjoiMzU1MTY0Mzk0MzU4OTI5NTU5OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 87e38a4cc79e1044a18e16ba7ca1bc6578454c592feb26ef371f1897f72f7e94 |
| hovercard-subject-tag | issue:2889236833 |
| 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/130750/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e0deabf54c216b4bbb2f29fa152c53d7f96fbdfb6f1a81fc4f624adbf7ad7406/python/cpython/issues/130750 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e0deabf54c216b4bbb2f29fa152c53d7f96fbdfb6f1a81fc4f624adbf7ad7406/python/cpython/issues/130750 |
| og:image:alt | In the current documentation on the error message when invalid args are passed states that the available choices are single-quoted, but they actually aren't, both according to argparse's code and i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | TheDSCPL |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| 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 | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width