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 bethard, derelbenkoenig, paul.j3
Date 2018-10-17.06:47:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1539758841.97.0.788709270274.issue35005@psf.upfronthosting.co.za>
In-reply-to
Content
The results of reading one of these @-prefix files are just spliced into the `argv` list before it is parsed.  This is done early in the parsing method, in the 

_read_args_from_files

method.  The documentation illustrates how this file reading can be modified to take several strings from each line:

https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.convert_arg_line_to_args

That shouldn't be taken as the only possible modification.

That said, I don't see how reading from a JSON or YAML file fits with this mechanism.  Presumably those would define some dictionary like key:value pairs.  I assume you'd want to enter those directly into the Namespace, not the argv list that will be parsed.  Or otherwise merged with a dictionary produced by parsing the other commandline strings.

So what you want to do with a JSON file, and how that relates to argparse is not clear.  You need to elaborate before we can discuss this issue further.

You might want to search on Stackoverflow with the tags '[argparse] [json]' to see how others have tried to use the two together.
History
Date User Action Args
2018-10-17 06:47:22paul.j3setrecipients: + paul.j3, bethard, derelbenkoenig
2018-10-17 06:47:21paul.j3setmessageid: <1539758841.97.0.788709270274.issue35005@psf.upfronthosting.co.za>
2018-10-17 06:47:21paul.j3linkissue35005 messages
2018-10-17 06:47:21paul.j3create