[New-bugs-announce] [issue40365] argparse: action "extend" with 1 parameter splits strings into characters

strjan report at bugs.python.org
Wed Apr 22 13:42:36 EDT 2020


New submission from strjan <str.jan at seznam.cz>:

When positional argument with action='extend' is given to parse only one string argument, the string is splitted into individual characters.

The problem occures, when no "nargs" is given; it makes sense that nargs is requiered, though at least notion in documentation would be nice, as the issue does not occure with action='append'

Minimal example included.

----------
files: argparse_bug.py
messages: 367033
nosy: strjan
priority: normal
severity: normal
status: open
title: argparse: action "extend" with 1 parameter splits strings into characters
type: behavior
versions: Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49086/argparse_bug.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40365>
_______________________________________


More information about the New-bugs-announce mailing list