Title: bpo-43874: fix argparse sub parser error when sub parser has no "name" by terencehonles · Pull Request #25446 · python/cpython · GitHub
Open Graph Title: bpo-43874: fix argparse sub parser error when sub parser has no "name" by terencehonles · Pull Request #25446 · python/cpython
X Title: bpo-43874: fix argparse sub parser error when sub parser has no "name" by terencehonles · Pull Request #25446 · python/cpython
Description: This change updates the following crash to instead produce the error message "%(prog)s: error: the following arguments are required: command".
Previously, when creating a simple required sub parser the following will result in an error instead of an error message:
>>> from argparse import ArgumentParser
>>>
>>> parser = ArgumentParser()
>>> subparsers = parser.add_subparsers(required=True)
>>> subparsers.add_parser('one')
>>> subparsers.add_parser('two')
>>>
>>> parser.parse_args([])
Traceback (most recent call last):
File "
Open Graph Description: This change updates the following crash to instead produce the error message "%(prog)s: error: the following arguments are required: command". Previously, when creating a simple required ...
X Description: This change updates the following crash to instead produce the error message "%(prog)s: error: the following arguments are required: command". Previously, when creating a simple r...
Opengraph URL: https://github.com/python/cpython/pull/25446
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:0833d3f4-2455-5cf9-e5ab-c9f1dc8decc0 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 82B8:132F24:3413ECA:47D130F:6A508982 |
| html-safe-nonce | f6c65c7eed08b97581b42a840e277d13eec45ea27f8728e4894ae34f984c1966 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MkI4OjEzMkYyNDozNDEzRUNBOjQ3RDEzMEY6NkE1MDg5ODIiLCJ2aXNpdG9yX2lkIjoiMjc1OTE5ODg2ODA0MjE4OTE4NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1a0a127d541be78e42d28d98227104eab067be58fb33688b8e9829e0d07ab702 |
| hovercard-subject-tag | pull_request:617057623 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/python/cpython/pull/25446/files |
| twitter:image | https://avatars.githubusercontent.com/u/438813?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/438813?s=400&v=4 |
| og:image:alt | This change updates the following crash to instead produce the error message "%(prog)s: error: the following arguments are required: command". Previously, when creating a simple required ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7ac0ad2f2c7e4b9056617355fd9e33e22b0c8df9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width