[issue29670] argparse: does not respect required args pre-populated into namespace

2017-11-26 Thread Antonio Valentino
Change by Antonio Valentino : -- nosy: +avalentino ___ Python tracker ___ ___

[issue29670] argparse: does not respect required args pre-populated into namespace

2017-07-30 Thread paul j3
paul j3 added the comment: Another pre-existing namespace issue http://bugs.python.org/issue28734 When positional nargs='?' or '*', the default (or []) overwrites the namespace value. That's because the posiitonals are always 'seen' (by an empty string), and `get_values` has special

[issue29670] argparse: does not respect required args pre-populated into namespace

2017-05-29 Thread paul j3
paul j3 added the comment: http://bugs.python.org/issue27859 argparse - subparsers does not retain namespace may complicate this issue. Due to changes in http://bugs.python.org/issue9351, a user defined namespace is not passed to the subparsers. They get a fresh namespace, which is then

[issue29670] argparse: does not respect required args pre-populated into namespace

2017-05-28 Thread paul j3
paul j3 added the comment: http://bugs.python.org/issue26394 Have argparse provide ability to require a fallback value be present is a related issue - getting 'required' values from a config file. -- ___ Python tracker

[issue29670] argparse: does not respect required args pre-populated into namespace

2017-03-04 Thread paul j3
paul j3 added the comment: One refactoring that I'd like to see is to move all the tests at the end of _parse_know_known_args to its caller, parse_known_args. It would have to return more values than the current namespace and extras, in particular the see_actions and

[issue29670] argparse: does not respect required args pre-populated into namespace

2017-03-03 Thread paul j3
paul j3 added the comment: What issue might have changed this behavior? I'm not aware of any that were trying to change either the `seen_actions` and the 'required' tests, not any dealing with pre-existing values in Namespace. The current handling of defaults complicates respecting

[issue29670] argparse: does not respect required args pre-populated into namespace

2017-03-03 Thread Terry J. Reedy
Terry J. Reedy added the comment: Can you test on 3.6? This might have been fixed and not back-ported. -- nosy: +bethard, terry.reedy ___ Python tracker

[issue29670] argparse: does not respect required args pre-populated into namespace

2017-02-27 Thread Matthew Hall
New submission from Matthew Hall: I have some Python code which takes advantage of the ability to prepopulate the argparse Namespace before passing it to argparse. This allows me to read sensitive settings such as usernames and passwords from DBs, environment variables, etc. in addition to