[issue16786] argparse doesn't offer localization interface for "version" action

paul j3 report at bugs.python.org
Mon Jul 14 08:15:59 CEST 2014


paul j3 added the comment:

In this patch I added the '_()' localization to the '_VersionAction' default 'help'.

While this is a straight forward change, I haven't tested it.  It does run test_argparse.py, but that doesn't have any tests for localization.

According to the discussion here:
https://mail.python.org/pipermail/python-dev/2010-May/100215.html
this default help was originally None, and adding this string was seen
as a worthwhile convenience.  Localization was not considered.

Does this use of _() really save the user effort?  May be it would if they are already using the depricated version.  Otherwise they could just give the version argument their own non default help line.  I haven't used localization enough to know.

----------
keywords: +patch
Added file: http://bugs.python.org/file35950/patch_1.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16786>
_______________________________________


More information about the Python-bugs-list mailing list