Can't set `print_area` to None
Example:
from openpyxl import Workbook
wb = Workbook()
ws = wb.active
# Get the current print area, correctly returns None
print(ws.print_area)
# Print area is set correctly
ws.print_area = "A1:B10"
print(ws.print_area)
# Clear the print area
ws.print_area = None # Error here "'NoneType' object is not iterable"
print(ws.print_area)
Can't work out how to get a merge request in but you could fix this by changing line 892 of worksheet.py to:
if value != None:
self._print_area = [absolute_coordinate(v) for v in value]
else:
self._print_area = None
Test (Line 420 of test_worksheet.py)
@pytest.mark.parametrize("cell_range, result",
[
("A1:F5", ["$A$1:$F$5"]),
(["$A$1:$F$5"], ["$A$1:$F$5"],),
(None, None),
]