This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年09月02日 13:12 by zbysz, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| argparse_parse_args_tuple.diff | zbysz, 2012年09月02日 20:51 | tests and patch fixing the problem, v2 | ||
| Messages (10) | |||
|---|---|---|---|
| msg169695 - (view) | Author: Zbyszek Jędrzejewski-Szmek (zbysz) * | Date: 2012年09月02日 13:12 | |
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. |
|||
| msg169703 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年09月02日 14:42 | |
I wonder if this is problematic enough that it should be treated as a regression and fixed in the next RC? |
|||
| msg169704 - (view) | Author: Zbyszek Jędrzejewski-Szmek (zbysz) * | Date: 2012年09月02日 14:44 | |
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 |
|||
| msg169705 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年09月02日 14:47 | |
Let's see what Georg thinks. |
|||
| msg169710 - (view) | Author: Steven Bethard (bethard) * (Python committer) | Date: 2012年09月02日 17:37 | |
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.
|
|||
| msg169723 - (view) | Author: Zbyszek Jędrzejewski-Szmek (zbysz) * | Date: 2012年09月02日 20:52 | |
Thanks for noticing. Replaced patch with the ('x') -> ('x',) bugfix.
|
|||
| msg169746 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2012年09月03日 05:45 | |
I agree this is a regression and should be fixed. |
|||
| msg170033 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2012年09月08日 05:58 | |
Committed in release clone as 8c2e87aeb707. Please apply to the main branches as usual. |
|||
| msg170055 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年09月08日 16:35 | |
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 |
|||
| msg170056 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年09月08日 16:36 | |
Thanks, Zbyszek. I'm glad you caught this. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:35 | admin | set | github: 60051 |
| 2012年09月08日 16:36:44 | r.david.murray | set | status: open -> closed resolution: fixed messages: + msg170056 stage: resolved |
| 2012年09月08日 16:35:06 | python-dev | set | nosy:
+ python-dev messages: + msg170055 |
| 2012年09月08日 05:58:36 | georg.brandl | set | priority: release blocker -> high messages: + msg170033 |
| 2012年09月03日 05:45:35 | georg.brandl | set | messages: + msg169746 |
| 2012年09月02日 20:52:52 | zbysz | set | messages: + msg169723 |
| 2012年09月02日 20:52:16 | zbysz | set | files: - argparse_parse_args_tuple.diff |
| 2012年09月02日 20:51:52 | zbysz | set | files: + argparse_parse_args_tuple.diff |
| 2012年09月02日 17:37:54 | bethard | set | messages: + msg169710 |
| 2012年09月02日 14:47:45 | r.david.murray | set | priority: normal -> release blocker nosy: + georg.brandl, benjamin.peterson messages: + msg169705 |
| 2012年09月02日 14:44:20 | zbysz | set | messages: + msg169704 |
| 2012年09月02日 14:42:33 | r.david.murray | set | messages: + msg169703 |
| 2012年09月02日 13:12:14 | zbysz | create | |