[issue36371] FancyGetopt.generate_help crashes with TypeError

2019-03-19 Thread SilentGhost


SilentGhost  added the comment:

I'm not sure why you're using distutils, but two extra spaces at the end of 
string is not likely to be fixed. The module is frozen and only present in the 
tree for historical reasons.

--
components: +Distutils
nosy: +SilentGhost, dstufft, eric.araujo
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36371] FancyGetopt.generate_help crashes with TypeError

2019-03-19 Thread Maxim


Change by Maxim :


--
keywords: +patch
pull_requests: +12400
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36371] FancyGetopt.generate_help crashes with TypeError

2019-03-19 Thread Maxim


New submission from Maxim :

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)
 in 
> 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.

--
components: Library (Lib)
messages: 338401
nosy: crztssr
priority: normal
severity: normal
status: open
title: FancyGetopt.generate_help crashes with TypeError
type: behavior
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com