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

Uncaught Python exception - ValueError: could not convert string to float: 'True'

Open astanin opened this issue 3 years ago • 3 comments

Fuzzer issue 50322

  === Uncaught Python exception: ===
  ValueError: could not convert string to float: 'True'
  Traceback (most recent call last):
  File "fuzz_tabulate.py", line 37, in TestOneInput
  File "tabulate/init.py", line 2171, in tabulate
  File "tabulate/init.py", line 2172, in <listcomp>
  File "tabulate/init.py", line 2172, in <listcomp>
  File "tabulate/init.py", line 1239, in _format

astanin avatar Oct 19 '22 13:10 astanin

Probably related: #189

astanin avatar Oct 19 '22 15:10 astanin

Hi @astanin, is it possible to fix this issue? We are running into this issue in a third party software in production and would love to see https://github.com/astanin/python-tabulate/pull/236 being reviewed and merged.

jimmyzzxhlh avatar Oct 10 '23 22:10 jimmyzzxhlh

I think it is related to an issue I just stumbled upon:

tabulate.tabulate([['False'], ['1.']]) will raise a ValueError, my understanding is that it tries to convert the whole column to float, then fails with False. The behaviour I would expect is to not convert anything, I pass strings for a reason, if I want numbers I will pass numbers.

fabiensatalia avatar Jul 25 '24 15:07 fabiensatalia