astanin / python-tabulate

Pretty-print tabular data in Python, a library and a command-line utility. Repository migrated from bitbucket.org/astanin/python-tabulate.
https://pypi.org/project/tabulate/
MIT License
2.16k stars 165 forks source link

Adding a SEPARATING_LINE fails, for any format with padding #246

Closed pjkundert closed 2 weeks ago

pjkundert commented 1 year ago

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.