[New-bugs-announce] [issue34865] Incorrect assignment of optional argument when partial match with different argument found.

Rob Dalton report at bugs.python.org
Mon Oct 1 16:36:46 EDT 2018


New submission from Rob Dalton <robcdalton at gmail.com>:

Parsing an unknown optional argument whose leading characters (e.g. '--user') match those of another, known optional argument (e.g. '--userdata') causes the unknown argument to be parsed as the known one.

For example - passing the unknown argument '--user' to a parser with the known argument '--userdata' assigns the passed '--user' value to '--userdata'.

Here's my setup info:
  Python: Python 3.6.3 :: Anaconda custom (64-bit)
  OS: MacOS High Sierra 10.13.6 

Wrote up some example cases here:
  https://gist.github.com/rob-dalton/9ec06b8d5e2e9083713ddc7884d16072

----------
components: Library (Lib)
messages: 326824
nosy: rob-dalton
priority: normal
severity: normal
status: open
title: Incorrect assignment of optional argument when partial match with different argument found.
type: behavior
versions: Python 3.6

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


More information about the New-bugs-announce mailing list