GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-9938: Add optional keyword argument exit_on_error to argparse.ArgumentParser by shihai1991 · Pull Request #15362 · python/cpython

Conversation

@shihai1991

@shihai1991 shihai1991 commented Aug 21, 2019 •
edited by miss-islington
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Co-Authored-by: Xuanji Li [email protected]

https://bugs.python.org/issue9938

Automerge-Triggered-By: @matrixise

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@shihai1991
Improving interactive use of argparse
c1c85e1
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Aug 21, 2019
@bedevere-bot bedevere-bot added the awaiting review label Aug 21, 2019
@blurb-it
📜🤖 Added by blurb_it.
948e135
@shihai1991 shihai1991 changed the title bpo-9938: Improving interactive use of argparse bpo-9938: Improve interactive use of argparse Aug 21, 2019
aeros
aeros suggested changes Aug 22, 2019
View reviewed changes

@aeros aeros left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @shihai1991! I could definitely see the addition of an exit_on_error argument being quite useful to give users more customization.

I would recommend the following additions:

  1. Update the docstring by adding the following on line 1626 (in Lib/argparse.py):
- exit_on_error -- Determines whether or not argparser exits when an error occurs.
  1. Update the docs for ArgumentParser.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Misc/NEWS.d/next/Library/2019-08-21-16-38-56.bpo-9938.t3G7N9.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels Aug 22, 2019
@aeros aeros added the type-feature A feature request or enhancement label Aug 22, 2019
@aeros

aeros commented Aug 22, 2019 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Also, I would recommend adjusting the PR title to [bpo-9938](https://bugs.python.org/issue9938): Add optional kwarg to ArgParser. This will allow core devs to more easily identify what the PR is addressing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeros

aeros commented Aug 22, 2019

Copy link
Copy Markdown
Contributor

The Travis CI failure can be fixed by locally running make patchcheck to address the whitespace issue. The problem seems to be occurring from Lib/test/test_argparse.py.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@shihai1991
update desc
07336d5
@shihai1991

shihai1991 commented Aug 22, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Thanks for the PR @shihai1991! I could definitely see the addition of an exit_on_error argument being quite useful to give users more customization.

I would recommend the following additions:

  1. Update the docstring by adding the following on line 1626 (in Lib/argparse.py):
- exit_on_error -- Determines whether or not argparser exits when an error occurs.
  1. Update the docs for ArgumentParser.

Looks Determines whether or not argparser exits with error when an error occurs would better. ;)

  • exit_on_error -- Determines whether or not argparser exits when an error occurs.

np.

aeros reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@shihai1991 shihai1991 changed the title bpo-9938: Improve interactive use of argparse bpo-9938: Add optional kwargs to argparse Aug 22, 2019
@shihai1991

shihai1991 commented Aug 22, 2019

Copy link
Copy Markdown
Member Author

Also, I would recommend adjusting the PR title to [bpo-9938](https://bugs.python.org/issue9938): Add optional kwarg to ArgParser. This will allow core devs to more easily identify what the PR is addressing.

the desc looks good to me. But why the title need add the bpo link now? the format of title have been changed?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aeros
aeros approved these changes Aug 22, 2019
View reviewed changes

@aeros aeros left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shihai1991

the desc looks good to me. But why the title need add the bpo link now? the format of title have been changed?

I may have been a bit unclear, apologies. I just included the bpo part so that you wouldn't accidentally remove it when editing the title and I didn't intend to include the link. It looks good now.

Thanks for making the recommended changes.

I have a couple of minor grammar suggestions, but once those are added, everything documentation-related looks good as far as I can tell. (:

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/argparse.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/argparse.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/argparse.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

shihai1991 and others added 2 commits August 23, 2019 12:49
@shihai1991 @aeros
Update Lib/argparse.py
8cb0b26
Co-Authored-By: Kyle Stanley <[email protected]>
@shihai1991 @aeros
Update Doc/library/argparse.rst
a163c4a
Co-Authored-By: Kyle Stanley <[email protected]>
@shihai1991

shihai1991 commented Aug 23, 2019

Copy link
Copy Markdown
Member Author

@shihai1991

the desc looks good to me. But why the title need add the bpo link now? the format of title have been changed?

I may have been a bit unclear, apologies. I just included the bpo part so that you wouldn't accidentally remove it when editing the title and I didn't intend to include the link. It looks good now.

Thanks for making the recommended changes.

I have a couple of minor grammar suggestions, but once those are added, everything documentation-related looks good as far as I can tell. (:

thanks, good job :)

aeros reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

shihai1991 added 3 commits August 24, 2019 00:58
@shihai1991
add argument examples
bdecd79
@shihai1991
update argument's desc
1eadaee
@shihai1991
update detail of colon
25924d1
@shihai1991

shihai1991 commented Aug 23, 2019

Copy link
Copy Markdown
Member Author

cc @rhettinger

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aeros
aeros reviewed Aug 24, 2019
View reviewed changes
Comment thread Doc/library/argparse.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

aeros
aeros reviewed Aug 24, 2019
View reviewed changes
Comment thread Doc/library/argparse.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

shihai1991 and others added 2 commits August 24, 2019 10:23
@shihai1991 @aeros
Update Doc/library/argparse.rst
872b47a
Co-Authored-By: Kyle Stanley <[email protected]>
@shihai1991 @aeros
Update Doc/library/argparse.rst
facfb4c
Co-Authored-By: Kyle Stanley <[email protected]>
aeros
aeros approved these changes Aug 24, 2019
View reviewed changes
@matrixise matrixise self-assigned this Sep 11, 2019
@matrixise matrixise changed the title bpo-9938: Add optional kwargs to argparse bpo-9938: Add optional keyword argument exit_on_error to argparse.ArgumentParser Sep 11, 2019
matrixise
matrixise suggested changes Sep 11, 2019
View reviewed changes

@matrixise matrixise left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR, please update with my remarks.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/argparse.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/argparse.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/argparse.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting changes and removed awaiting core review labels Sep 11, 2019
@bedevere-bot

bedevere-bot commented Sep 11, 2019

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@shihai1991
update desc of exit_on_error in argparse
aee9372
@shihai1991

shihai1991 commented Sep 12, 2019

Copy link
Copy Markdown
Member Author

I have made the requested changes; please review again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting change review and removed awaiting changes labels Sep 12, 2019
@bedevere-bot

bedevere-bot commented Sep 12, 2019

Copy link
Copy Markdown

Thanks for making the requested changes!

@matrixise: please review the changes made to this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot
bedevere-bot requested a review from matrixise September 12, 2019 00:34
matrixise
matrixise suggested changes Sep 12, 2019
View reviewed changes
Comment thread Doc/library/argparse.rst Outdated
abbreviation is unambiguous. (default: ``True``)

* exit_on_error_ - Determines whether or not ArgumentParser exits with
error info when an error occur. (default: ``True``)

@matrixise matrixise Sep 12, 2019

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when an error occurs

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@shihai1991 shihai1991 Sep 12, 2019

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ops, thank you :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot

bedevere-bot commented Sep 12, 2019

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting changes and removed awaiting change review labels Sep 12, 2019
@matrixise
Fix typo
03451ed
matrixise
matrixise approved these changes Sep 12, 2019
View reviewed changes

@matrixise matrixise left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR, I have fixed one Typo, but for the rest, I agree.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aeros reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting changes labels Sep 12, 2019
@matrixise matrixise added the 🤖 automerge label Sep 12, 2019
@miss-islington

miss-islington commented Sep 12, 2019

Copy link
Copy Markdown
Contributor

@shihai1991: Status check is done, and it's a success ✅ .

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington
miss-islington merged commit f545638 into python:master Sep 12, 2019
@bedevere-bot bedevere-bot removed the awaiting merge label Sep 12, 2019
DinoV pushed a commit to DinoV/cpython that referenced this pull request Sep 12, 2019
@shihai1991 @DinoV
bpo-9938: Add optional keyword argument exit_on_error to argparse.Arg…
6b2e857
…umentParser (pythonGH-15362)

Co-Authored-by: Xuanji Li <[email protected]>


https://bugs.python.org/issue9938



Automerge-Triggered-By: @matrixise
@sunmy2019 sunmy2019 mentioned this pull request Apr 13, 2023
argparse exits on error even when exit_on_error=False #103498
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

2 more reviewers
@matrixise matrixise matrixise approved these changes
@aeros aeros aeros approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@matrixise matrixise

Labels

type-feature A feature request or enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@shihai1991 @aeros @bedevere-bot @miss-islington @matrixise @the-knights-who-say-ni
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.