-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-35970: Add help flag to base64 util #11789
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
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your 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 your contribution, we look forward to reviewing it! |
Hi @rkuska, thanks for your contribution! This is bug and all bugs are worth fixing! There is some process to follow before submitting changes to Python, you can read about them at https://devguide.python.org/pullrequest/#quick-guide You first need to create an account on https://bugs.python.org/ and open a new issue. Your Pull Request will also need a test before being accepted. You should also use https://blurb-it.herokuapp.com/ to add a news entry to your PR. |
I've created an issue and changed commit message and also edited PR title and lastly news entry was added. I will add also tests once I will get some ack about my fix - not sure if getopt shouldn't be replaced by argparse. |
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.
I'm not sure getopt needs to be replaced, optparse has been deprecated but not getopt.
Lib/base64.py
Outdated
@@ -558,22 +558,25 @@ def decodestring(s): | |||
def main(): | |||
"""Small main program""" | |||
import sys, getopt | |||
usage = """usage: %s [-h|-d|-e|-u|-t] [file|-] |
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.
I think you can convert this to an f-string
@@ -0,0 +1 @@ | |||
Add help flag to base64 cmd utility |
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.
Add Patch contributed by ...
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.
This certainly would be a nice improvement.
Please add two simple tests checking that the usage text is printed:
- Running with
-h
- Running with an invalid parameter
(See TestMain
in test_base64.py
)
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 |
Ping, @rkuska? |
Oops, I think I accidentally closed this while trying to update rkuska's branch. Let me update this work in a new PR. |
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
Probably a really unnecessary contribution but I failed today to print help message for base64 utility without an error:
So I felt like this is a ripple in time space continuum worth adjusting. I understand that this part of code is probably a long forgotten and therefore I will not be surprised if you decide to just close this PR.
https://bugs.python.org/issue35970