1. Sergey Astanin
  2. python-tabulate
  3. Issues
Issue #29 resolved

Exception being thrown

Anonymous created an issue

Thank you for your work on this module. During my testing I came across an exception being thrown. Modifying line 215 has fixed the issue for me.

except (TypeError, ValueError):
Traceback (most recent call last):
  File "/Users/swoodall6/pgextra_test.py", line 11, in <module>
    print(tabulate(records, headers=columns, tablefmt='orgtbl'))
  File "/Volumes/data/Source/personal/python-pgextras/venv/lib/python2.7/site-packages/tabulate.py", line 753, in tabulate
    coltypes = list(map(_column_type, cols))
  File "/Volumes/data/Source/personal/python-pgextras/venv/lib/python2.7/site-packages/tabulate.py", line 426, in _column_type
    types = [_type(s, has_invisible) for s in strings ]
  File "/Volumes/data/Source/personal/python-pgextras/venv/lib/python2.7/site-packages/tabulate.py", line 269, in _type
    elif _isnumber(string):
  File "/Volumes/data/Source/personal/python-pgextras/venv/lib/python2.7/site-packages/tabulate.py", line 228, in _isnumber
    return _isconvertible(float, string)
  File "/Volumes/data/Source/personal/python-pgextras/venv/lib/python2.7/site-packages/tabulate.py", line 213, in _isconvertible
    n = conv(string)
TypeError: float() argument must be a string or a number