When I run my program, I immediately get an AttributeError
when it's setting up the argument parser:
Traceback (most recent call last):
File "blah.py", line 55, in <module>
parser.add_argument('--select-equal', '--equal', nargs=2, metavar=[ 'COLUMN', 'VALUE' ], action='append', dest='filter_equality_keys_and_values', default=[], help='Only return rows for which this column is exactly equal to this value.')
File "…/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/argparse.py", line 1346, in add_argument
chars = self.prefix_chars
AttributeError: 'str' object has no attribute 'prefix_chars'
Well, that sounds reasonable. str
s indeed don't have a prefix_chars
attribute. Clearly the exception message is correct.
Except I can't parse arguments, or even get to parsing arguments, because of this exception. Why is this throwing an exception? Why is it trying to get prefix_chars
of a str
in the first place? The exception is coming from inside the Python module; is this a bug in Python or something I'm doing wrong?