-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
What steps will reproduce the problem?
1. Make a script containing this code:
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input-base-directory',
type=argparse.FileType('r'),
default='/home')
parser.parse_args()
2. Run the script with '-h'.
3. See it complain that '/home' is a directory
What is the expected output? What do you see instead?
With '-h', we just need to print the help message. We shouldn't fail on a
default value that's wrong or else the help message will not get printed and
the user will have no idea what the problem is. This is a valid use case as I
want to provide a default location, but I can't guarantee that the location
exists on the user's machine. I end up doing my own checking.
What version of the product are you using? On what operating system?
1.1 on Fedora 15.
Please provide any additional information below.
Original issue reported on code.google.com by [email protected] on 25 Oct 2011 at 7:27