[Python-Dev] Issue 15906; regression in argparse in Python 3.3, 3.2, and 2.7

Barry Warsaw barry at python.org
Wed Sep 12 01:55:37 CEST 2012

On Sep 11, 2012, at 05:30 PM, Terry Reedy wrote:

>> And yet, that's how it works in 2.7, 3.2, and 3.3.1.
>In all 2.7 or 3.2?

It will be broken in 2.7.4 and 3.2.4, but the Ubuntu packages in 12.10 are
currently affected because they pulled in some Mercurial updates which
included these unreleased changes.  That's where it was first noticed.

>How about a third rule which amounts to the second *plus* (maybe) the first:
>apply the conversion when it fulfills the purpose of having type conversions,
>which is to make sure that the caller get objects of the desired class. Also,
>only add necessary restrictions to argparse users.

I've tried the various suggestions out, and I think from a practical point of
view, a fix for the regression in the 2.7, 3.2 and 3.3 branches should be to
apply the one line check for action being a _StoreAction instance.  This seems
to be the easiest way to preserve the current behavior (the fix for issues
#12776 and #11839) and fix issue #15906.

I'll update the issue and apply this change to the three branches.  Georg can
ignore the change for 3.3.0.


More information about the Python-Dev mailing list