paul j3 <ajipa...@gmail.com> added the comment:
Your code runs fine under 3.6.5. But if I add 'subparsers.required=True', I get your error. It's having problems formatting the name of the subparsers command when issuing the error message. If I add a 'dest' to the add_subparsers I get the expected error message: import argparse parser = argparse.ArgumentParser(description="Automatically process XML") subparsers = parser.add_subparsers(title='subcommands', dest='cmd') subparsers.required=True chain_parser = subparsers.add_parser('chain', aliases=['c'], help='Automatically run a chain of transformations') args = parser.parse_args() print(args) The default 'dest' for subparsers is None, and the error arises from ','.join([None]) The problems with a missing 'dest' came up in earlier discussions about making required/not required subparsers. 3.7 made subparsers 'required' by default, but it appears that it hasn't addressed this missing 'dest' problem. But I haven't followed the latest release details closely. ---------- nosy: +paul.j3 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34191> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com