summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/pwpolicy.py
diff options
context:
space:
mode:
authorJohn Dennis <jdennis@redhat.com>2010-03-04 18:41:51 -0500
committerRob Crittenden <rcritten@redhat.com>2010-03-05 10:03:41 -0500
commit789cba4378a14c1651a780559e2103aef3d8d67a (patch)
treeadd3c3caed112342c7b02eefba5915b1c42097a8 /ipalib/plugins/pwpolicy.py
parent1289285d491caa67edaeab623e9fbcaaf1a253ff (diff)
downloadfreeipa-789cba4378a14c1651a780559e2103aef3d8d67a.tar.gz
freeipa-789cba4378a14c1651a780559e2103aef3d8d67a.tar.xz
freeipa-789cba4378a14c1651a780559e2103aef3d8d67a.zip
fix bug 570392, command help traceback
As a consequence of using doc=_('some message') the _() method was returning a Gettext instance, thus when optparse was handed the help text it received a Gettext instance instead of a basestring. optparse tried to operate on the Gettext instance as if it were a basestring and since it wasn't threw an exception. The fix is to promote (e.g. cast) the option.doc to unicode. If the option.doc was a str it becomes unicode, if it was unicode nothing happens, if it was Gettext (or any other object implementing the __unicode__() method) object is converted to unicode via the objects rules. By the way, while debugging this I discovered strings which were not localized, sometimes option.doc would be a str and sometimes a Gettext object. In a subsequent patch I'll fix all those unlocalized doc strings, but I don't want to bury this fix along with a load of string fixes.
Diffstat (limited to 'ipalib/plugins/pwpolicy.py')
0 files changed, 0 insertions, 0 deletions