[New-bugs-announce] [issue15874] argparse cannot parse bash variable arguments in file-given arguments

Nat Hillard report at bugs.python.org
Fri Sep 7 02:04:51 CEST 2012


New submission from Nat Hillard:

When using the argparse argument fromfile_prefix_chars to obtain command line arguments from a file, it is not possible to make use of bash environment variables within this file. 

Ideally one would be able to `export BAR='/Users/x/Desktop/bar'`, and then give arguments such as:

--foo
$BAR

and have this correctly expanded at read time to --foo '/Users/x/Desktop/bar'.

To my knowledge, this is currently only possible if you give the arguments directly via the command line:
python test.py --foo $BAR

It would be great to be able to use environment variables within files as well!

----------
components: Library (Lib)
messages: 169958
nosy: ZhuangZi, bethard
priority: normal
severity: normal
status: open
title: argparse cannot parse bash variable arguments in file-given arguments
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15874>
_______________________________________


More information about the New-bugs-announce mailing list