Steven Bethard steven.beth...@gmail.com added the comment:
Yes, the original patch looks fine to me. I applied and tested it, and it works
as expected.
Please go ahead and apply.
--
___
Python tracker rep...@bugs.python.org
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset ac53876d1cc8 by R David Murray in branch '3.2':
#12353: argparse now correctly handles null argument values.
http://hg.python.org/cpython/rev/ac53876d1cc8
New changeset c4ad8a6eb0df by R David Murray in branch
R. David Murray rdmur...@bitdance.com added the comment:
Done.
--
resolution: - fixed
stage: test needed - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12353
Changes by Zbyszek Szmek zbys...@in.waw.pl:
--
nosy: +zbysz
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12353
___
___
Python-bugs-list mailing
Torsten Landschoff t.landsch...@gmx.net added the comment:
ping!?
I think this should be either applied or dropped. It does not make sense to
have such a simple issue rot in the bug tracker...
--
___
Python tracker rep...@bugs.python.org
Torsten Landschoff t.landsch...@gmx.net added the comment:
Your unit test isn't consistent with the other unit tests in that set, which
makes me suspicious that it isn't testing what we need to test.
That is because I did not try to understand the machinery behind the argparse
unit tests
Torsten Landschoff t.landsch...@gmx.net added the comment:
Here is another possible patch that will catch the problem.
But this enables the fromfile_prefix_chars option for all tests checking empty
and space arguments. This way a problem that occurs only without that option
might be hidden.
R. David Murray rdmur...@bitdance.com added the comment:
Ah, I see now. I misread the original traceback.
Creating a new test case would be the appropriate way to go, given the
structure of the argparse test suite.
--
___
Python tracker
R. David Murray rdmur...@bitdance.com added the comment:
Actually, your original test might be fine. Let me double check the test
implementation.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12353
Torsten Landschoff t.landsch...@gmx.net added the comment:
Here is an updated patch including unit test coverage.
--
keywords: +patch
nosy: +torsten
Added file: http://bugs.python.org/file22430/issue12353_test.diff
___
Python tracker
R. David Murray rdmur...@bitdance.com added the comment:
Your unit test isn't consistent with the other unit tests in that set, which
makes me suspicious that it isn't testing what we need to test. Also, there
are unit tests for this case further up in the test file
New submission from Bryan Jacobs bjac...@woti.com:
Parsing arguments with argparse fails with an IndexError when one of the
arguments is the empty string (''). This is caused by an access to the zero'th
element of the argument value, without a preceding length check.
Fixed by the below patch:
R. David Murray rdmur...@bitdance.com added the comment:
Thanks for the report and patch. I'm setting this to test needed since the
final patch will need a unit test.
The idiomatic way to do this kind of check is 'if not argstring or
arg_string[0] not in self.fromfile_prefix_chars):'
13 matches
Mail list logo