Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue15847] parse_args stopped accepting tuples

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Sep 2, 2012, 6:12 AM

Post #1 of 12 (152 views)
Permalink
[issue15847] parse_args stopped accepting tuples

New submission from Zbyszek Jędrzejewski-Szmek:

After recent change (78307 '#13922: argparse no longer incorrectly strips '--' after the first one.'), parse_args stopped working with a tuple
argument. It is easy to pass tuple to argparse by using positional function arguments:

def f(*args):
parser.parse_args(args)

This will fail, because args is a tuple.

It is necessary to have at least one positional argument to trigger the bug.

----------
components: Library (Lib)
files: argparse_parse_args_tuple.diff
keywords: patch
messages: 169695
nosy: bethard, r.david.murray, zbysz
priority: normal
severity: normal
status: open
title: parse_args stopped accepting tuples
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file27095/argparse_parse_args_tuple.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15847>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Sep 2, 2012, 7:42 AM

Post #2 of 12 (148 views)
Permalink
[issue15847] parse_args stopped accepting tuples [In reply to]

R. David Murray added the comment:

I wonder if this is problematic enough that it should be treated as a regression and fixed in the next RC?

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15847>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Sep 2, 2012, 7:44 AM

Post #3 of 12 (148 views)
Permalink
[issue15847] parse_args stopped accepting tuples [In reply to]

Zbyszek Jędrzejewski-Szmek added the comment:

On Sun, Sep 02, 2012 at 02:42:34PM +0000, R. David Murray wrote:
>
> R. David Murray added the comment:
>
> I wonder if this is problematic enough that it should be treated as a regression and fixed in the next RC?
I believe yes, because I've already hit it in two different projects.
It is also causes susceptible programs to fail completely.

Zbyszek

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15847>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Sep 2, 2012, 7:47 AM

Post #4 of 12 (148 views)
Permalink
[issue15847] parse_args stopped accepting tuples [In reply to]

R. David Murray added the comment:

Let's see what Georg thinks.

----------
nosy: +benjamin.peterson, georg.brandl
priority: normal -> release blocker

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15847>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Sep 2, 2012, 10:37 AM

Post #5 of 12 (144 views)
Permalink
[issue15847] parse_args stopped accepting tuples [In reply to]

Steven Bethard added the comment:

The fix looks about right to me.

There's a bug in the tests though:

parser.parse_args(('x'))

should probably be:

parser.parse_args(('x',))

since I assume the intent was to test tuples.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15847>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Sep 2, 2012, 1:51 PM

Post #6 of 12 (144 views)
Permalink
[issue15847] parse_args stopped accepting tuples [In reply to]

Changes by Zbyszek Jędrzejewski-Szmek <zbyszek [at] in>:


Added file: http://bugs.python.org/file27103/argparse_parse_args_tuple.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15847>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Sep 2, 2012, 1:52 PM

Post #7 of 12 (144 views)
Permalink
[issue15847] parse_args stopped accepting tuples [In reply to]

Changes by Zbyszek Jędrzejewski-Szmek <zbyszek [at] in>:


Removed file: http://bugs.python.org/file27095/argparse_parse_args_tuple.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15847>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Sep 2, 2012, 1:52 PM

Post #8 of 12 (144 views)
Permalink
[issue15847] parse_args stopped accepting tuples [In reply to]

Zbyszek Jędrzejewski-Szmek added the comment:

Thanks for noticing. Replaced patch with the ('x') -> ('x',) bugfix.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15847>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Sep 2, 2012, 10:45 PM

Post #9 of 12 (143 views)
Permalink
[issue15847] parse_args stopped accepting tuples [In reply to]

Georg Brandl added the comment:

I agree this is a regression and should be fixed.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15847>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Sep 7, 2012, 10:58 PM

Post #10 of 12 (129 views)
Permalink
[issue15847] parse_args stopped accepting tuples [In reply to]

Georg Brandl added the comment:

Committed in release clone as 8c2e87aeb707. Please apply to the main branches as usual.

----------
priority: release blocker -> high

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15847>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Sep 8, 2012, 9:35 AM

Post #11 of 12 (128 views)
Permalink
[issue15847] parse_args stopped accepting tuples [In reply to]

Roundup Robot added the comment:

New changeset 5d8454fcc629 by R David Murray in branch '3.2':
#15847: allow args to be a tuple in parse_args
http://hg.python.org/cpython/rev/5d8454fcc629

New changeset 76655483c5c8 by R David Murray in branch 'default':
merge #15847: allow args to be a tuple in parse_args
http://hg.python.org/cpython/rev/76655483c5c8

New changeset a2147bbf7868 by R David Murray in branch '2.7':
#15847: allow args to be a tuple in parse_args
http://hg.python.org/cpython/rev/a2147bbf7868

----------
nosy: +python-dev

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15847>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Sep 8, 2012, 9:36 AM

Post #12 of 12 (129 views)
Permalink
[issue15847] parse_args stopped accepting tuples [In reply to]

R. David Murray added the comment:

Thanks, Zbyszek. I'm glad you caught this.

----------
resolution: -> fixed
stage: -> committed/rejected
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15847>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.