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.

Author crztssr
Recipients crztssr
Date 2019-03-19.19:28:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1553023721.87.0.244603228495.issue36371@roundup.psfhosted.org>
In-reply-to
Content
Hi!

FancyGetopt.generate_help crashes if help text in option_table is None:

instance = FancyGetopt([('long', 'l', None)])
help_text = instance.generate_help()

TypeError                                 Traceback (most recent call last)
<ipython-input-40-04e4e328455e> in <module>
----> 1 a.generate_help()

/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/fancy_getopt.py in generate_help(self, header)
    352                                  (max_opt, opt_names, text[0]))
    353                 else:
--> 354                     lines.append("  --%-*s" % opt_names)
    355
    356             for l in text[1:]:

TypeError: * wants int

This code is in master branch too.

And if help_text is empty string code behavior is like a help_text is actually pass and added 2 whitespaces.
History
Date User Action Args
2019-03-19 19:28:41crztssrsetrecipients: + crztssr
2019-03-19 19:28:41crztssrsetmessageid: <1553023721.87.0.244603228495.issue36371@roundup.psfhosted.org>
2019-03-19 19:28:41crztssrlinkissue36371 messages
2019-03-19 19:28:41crztssrcreate