In _wrap_text_to_colwidths, the per-cell numparse flag was passed
positionally to _type() as the has_invisible argument:
_type(cell, numparse)
so _type() always used its default numparse=True. A number-ish but
unparseable cell (e.g. '80,443') was then cast to int and crashed with
ValueError, but only when maxcolwidths triggered the wrap path -- the
non-wrap path honored disable_numparse correctly.
Pass numparse as a keyword argument. This restores the fix from astanin#362
(regression of astanin#305 / astanin#428).
Fixes astanin#428
Summary
Fixes #428 — a regression of #305 (originally fixed by #362), present on master and in v0.10.0.
When disable_numparse=True is combined with maxcolwidths, a cell that looks number-ish but cannot be parsed (e.g. '80,443', a comma-separated port list) crashes:
The same input works without maxcolwidths: disable_numparse is honored on the non-wrap path but ignored on the wrap path.
Root cause
In _wrap_text_to_colwidths, the per-cell numparse flag was passed positionally to _type():
_type's signature is _type(string, has_invisible=True, numparse=True), so numparse was actually filling has_invisible, and _type always ran with its default numparse=True. The unparseable cell was then cast to int.
Fix
Pass numparse as a keyword argument:
One-character-class change; has_invisible keeps its default.
Test plan