[issue32867] argparse assertion failure with multiline metavars

2021-12-15 Thread Irit Katriel
Irit Katriel added the comment: It works for me on 3.11: % ./python.exe b.py -h usage: 11 [-h] [-v] 123456 12345 12345 123 [123456 12345 12345 123 ...] positional arguments: 123456 12345 12345 123 installation targets options: -h, --help

[issue32867] argparse assertion failure with multiline metavars

2018-03-18 Thread paul j3
paul j3 added the comment: I haven't seen anyone try to use \n in a metavar before, but other special characters like [] and () produce this assertion error. At this point the code is trying split the usage into 2 or more lines, because it's too long for one. It creates

[issue32867] argparse assertion failure with multiline metavars

2018-02-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: If newlines are not permitted in metavars, the user should see ValueError: newline not permitted in metavar -- ___ Python tracker

[issue32867] argparse assertion failure with multiline metavars

2018-02-23 Thread MaT1g3R
MaT1g3R added the comment: I tried to include line breaks for listing options for a positional argument. The default metavar for that is something like {opt1, opt2, op3}, however I wanted it to display the options on separate lines. --

[issue32867] argparse assertion failure with multiline metavars

2018-02-23 Thread Martin Panter
Martin Panter added the comment: This looks like the same assertion failure as described in Issue 16360. Paul pointed to a patch in Issue 11874, so that may also be relevant. However I agree that embedding newlines in a metavar doesn’t make much sense. What’s the use

[issue32867] argparse assertion failure with multiline metavars

2018-02-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: I don't understand the -h (display help part) but pasting code into repository 3.8 IDLE editor and running, I get same traceback. Never having used argparse, I don't know if a multiline metavar is expected to work. Assuming so, can you

[issue32867] argparse assertion failure with multiline metavars

2018-02-17 Thread MaT1g3R
New submission from MaT1g3R : If I run this script with -h -8<-- from argparse import ArgumentParser mapping = ['123456', '12345', '12345', '123'] p = ArgumentParser('11') p.add_argument('-v', '--verbose', help='verbose mode',