This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author paul.j3
Recipients paul.j3, porton
Date 2018-07-23.16:16:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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')
    chain_parser = subparsers.add_parser('chain', aliases=['c'], 
        help='Automatically run a chain of transformations')

    args = parser.parse_args()

The default 'dest' for subparsers is None, and the error arises from


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.
Date User Action Args
2018-07-23 16:16:37paul.j3setrecipients: + paul.j3, porton
2018-07-23 16:16:37paul.j3setmessageid: <>
2018-07-23 16:16:37paul.j3linkissue34191 messages
2018-07-23 16:16:37paul.j3create