Issue 89 in argparse: pypi version does not handle empty arguments when fromfile_prefix_chars set (python issue 12353)

1 view
Skip to first unread message

argp...@googlecode.com

unread,
Jan 15, 2014, 12:17:07 PM1/15/14
to argpar...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 89 by will...@shallum.net: pypi version does not handle empty
arguments when fromfile_prefix_chars set (python issue 12353)
http://code.google.com/p/argparse/issues/detail?id=89

What steps will reproduce the problem?

>>> import argparse
>>> parser = argparse.ArgumentParser(fromfile_prefix_chars='@')
>>> parser.parse_args([''])


What is the expected output? What do you see instead?

Traceback (most recent call last):
File "<stdin>", line 1, in <module>

File "/usr/lib/python2.6/site-packages/argparse-1.2.1-py2.6.egg/argparse.py",
line 1703, in parse_args
args, argv = self.parse_known_args(args, namespace)

File "/usr/lib/python2.6/site-packages/argparse-1.2.1-py2.6.egg/argparse.py",
line 1735, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)

File "/usr/lib/python2.6/site-packages/argparse-1.2.1-py2.6.egg/argparse.py",
line 1747, in _parse_known_args
arg_strings = self._read_args_from_files(arg_strings)

File "/usr/lib/python2.6/site-packages/argparse-1.2.1-py2.6.egg/argparse.py",
line 1985, in _read_args_from_files
if arg_string[0] not in self.fromfile_prefix_chars:
IndexError: string index out of range

What version of the product are you using? On what operating system?

1.2.1, CentOS 5 w/ Python 2.6.8 from EPEL repository.


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages