diff --git a/doc/gendoc.py b/doc/gendoc.py --- a/doc/gendoc.py +++ b/doc/gendoc.py @@ -85,7 +85,12 @@ if b'\n' in desc: # only remove line breaks and indentation desc = b' '.join(l.lstrip() for l in desc.split(b'\n')) - desc += default and _(b" (default: %s)") % bytes(default) or b"" + if default: + defaulttmpl = _(b" (default: %s)") + if defaulttmpl: + if not isinstance(default, bytes): + default = repr(default).encode('latin1') + desc += defaulttmpl % default yield (b", ".join(allopts), desc)