python-tabulate icon indicating copy to clipboard operation
python-tabulate copied to clipboard

Adding a SEPARATING_LINE fails, for any format with padding

Open pjkundert opened this issue 2 years ago • 0 comments

If a format with padding is used, the test for SEPARATING_LINE fails, resulting in a table containing an (unprintable) \x01 character instead of a separating line.

This is because the padding is applied before the test for SEPARATING_LINE. The row now contains " \x01 ", instead of "\x01", so the test fails.

However, since multi-line cells are post-padded, the test succeeds, and a separating line is added!

So, instead of pre-padding the rows, always pad them immediately before output.

pjkundert avatar Feb 04 '23 11:02 pjkundert