Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pypi version does not handle empty arguments when fromfile_prefix_chars set (python issue 12353) #89

Open
GoogleCodeExporter opened this issue Mar 23, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

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.

Original issue reported on code.google.com by [email protected] on 15 Jan 2014 at 5:16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant