Skip to content

Fix error in argparse documentation example #17399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 28, 2020

Conversation

SarahPythonista
Copy link
Contributor

@SarahPythonista SarahPythonista commented Nov 27, 2019

Automerge-Triggered-By: @rhettinger

Automerge-Triggered-By: @aeros

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@SarahPythonista

This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting review labels Nov 27, 2019
@rhettinger rhettinger self-assigned this Nov 27, 2019
Copy link
Contributor

@aeros aeros left a 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 @SarahPythonista and welcome!

I tested the suggested changes in the REPL using Python 3.8 and received the following output:

>>> import argparse
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('--foo', required=True)
_StoreAction(option_strings=['--foo'], dest='foo', nargs=None, const=None, default=None, type=None, choices=None, help=None, metavar=None)
>>> parser.parse_args(['--foo', 'BAR'])
Namespace(foo='BAR')
>>> parser.parse_args([])
usage: [-h] --foo FOO
: error: the following arguments are required: --foo

The suggested changes look correct to me, good catch.

@aeros
Copy link
Contributor

aeros commented Nov 28, 2019

Also, if you're having issues with the CLA status not updating after 24 hours, I would recommend manually refreshing the status on GitHub through https://check-python-cla.herokuapp.com/.

@csabella
Copy link
Contributor

csabella commented Jan 5, 2020

@SarahPythonista, thank you for the PR. Your PR will be merged automatically once the CLA is signed. Please take a look at the comment from @aeros and leave a comment if you're having issues with the CLA. Thank you!

@miss-islington
Copy link
Contributor

Thanks @SarahPythonista for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖

@aeros aeros added the needs backport to 3.9 only security fixes label Aug 28, 2020
@miss-islington
Copy link
Contributor

Thanks @SarahPythonista for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 28, 2020
Automerge-Triggered-By: @rhettinger
(cherry picked from commit 8784d33)

Co-authored-by: SarahPythonista <4283226+SarahPythonista@users.noreply.github.com>
@bedevere-bot
Copy link

GH-21990 is a backport of this pull request to the 3.8 branch.

@bedevere-bot
Copy link

GH-21991 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 28, 2020
Automerge-Triggered-By: @rhettinger
(cherry picked from commit 8784d33)

Co-authored-by: SarahPythonista <4283226+SarahPythonista@users.noreply.github.com>
@bedevere-bot
Copy link

GH-21992 is a backport of this pull request to the 3.9 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Aug 28, 2020
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 28, 2020
Automerge-Triggered-By: @rhettinger
(cherry picked from commit 8784d33)

Co-authored-by: SarahPythonista <4283226+SarahPythonista@users.noreply.github.com>
@aeros
Copy link
Contributor

aeros commented Aug 28, 2020

Going to close the 3.7 backport PR (since we typically only do backports for the current version on docs.python.org and later).

@aeros
Copy link
Contributor

aeros commented Aug 28, 2020

Thanks for the reminder to take care of this PR @tirkarthi and to @SarahPythonista for the documentation example fix. :-)

miss-islington added a commit that referenced this pull request Sep 4, 2020
Automerge-Triggered-By: @rhettinger
(cherry picked from commit 8784d33)


Co-authored-by: SarahPythonista <4283226+SarahPythonista@users.noreply.github.com>
miss-islington added a commit that referenced this pull request Sep 4, 2020
Automerge-Triggered-By: @rhettinger
(cherry picked from commit 8784d33)


Co-authored-by: SarahPythonista <4283226+SarahPythonista@users.noreply.github.com>
xzy3 pushed a commit to xzy3/cpython that referenced this pull request Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip issue skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants