Closed
Description
Pylightxl Version: 1.58
Python Version: 3.7
Summary of Bug/Feature: When using sheet.row
with output='f'
, I get the traceback shown below. I've printed the sheet._data
dictionary and it does in fact have None
for some of the formulas. It is an array formula that I see it.
Traceback:
Traceback (most recent call last):
File "testing.py", line 285, in test_read
result = read_pylightxl(path)
File "testing.py", line 158, in read_with_pylightxl
page.append(sheet.row(row, output=output))
File "<snip>\site-packages\pylightxl\pylightxl.py", line 1796, in row
val = self.index(row, c, output=output)
File "<snip>\site-packages\pylightxl\pylightxl.py", line 1733, in index
return self.address(address, output=output)
File "<snip>\site-packages\pylightxl\pylightxl.py", line 1656, in address
rv = '=' + self._data[address]['f']
TypeError: can only concatenate str (not "NoneType") to str
Suggestion for fix (Option 1): Fix the immediate issue only
Change this
pylightxl/pylightxl/pylightxl.py
Line 1656 in 3729d0a
to:
rv = '=' + self._data[address]['f'] or ''
Suggestion for fix (Option 2): Avoid None earlier in the code for values, formulas, and comments
Change this
pylightxl/pylightxl/pylightxl.py
Line 494 in 3729d0a
to:
data.update({cell_address: {'v': cell_val or '', 'f': cell_formula or '', 's': '', 'c': comment or ''}})
Activity
PydPiper commentedon Oct 28, 2021
Hi @Spectre5 thank you for considering using pylightxl. It does in deed look like a bug, let me address it this week and ill get back to you. Thanks for submitting this!
added fix for issue #59
PydPiper commentedon Nov 2, 2021
Hi @Spectre5, thank you for submitting this comprehensive issue. It was really easy to go back and make the changes. I have updated the master, but will hold off on releasing a new version till we get a more more improvements in.
v1.59 release with fix for #59 and #36 expansion of datetime and time…