Workbook need check list index whether out of range in get_biff_data()

106 views
Skip to first unread message

richard shen

unread,
Sep 7, 2022, 5:26:11 AM9/7/22
to python-excel
Hi, 
During using the  latest version(1.3.0) xlwt, if I create a workbook without add any sheet, then try to save it, the code runs error that "self.__worksheets[self.__active_sheet] list out of range" in line 680 of Workbook.py. Error reason is that "self.__worksheets" is null after Workbook object is instantiated.

Thus, I think maybe we should add a check before line 680 in order to be sure that "self.__worksheets[self.__active_sheet]" is valid. If invalid, should raise an exception.

As the xlwt repository is real-only now, I give the suggestion here. Thanks.

Charlie Clark

unread,
Sep 7, 2022, 5:30:52 AM9/7/22
to python-excel
On 3 Sep 2022, at 7:04, richard shen wrote:

> As the xlwt repository is real-only now, I give the suggestion here. Thanks.

There are two good reasons for xlwt being frozen – there's no one prepared to maintain it and the file format is essentially deprecated – but nothing to stop you forking it for your own requirements.

Charlie

--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Sengelsweg 34
Düsseldorf
D- 40489
Tel: +49-203-3925-0390
Mobile: +49-178-782-6226
Reply all
Reply to author
Forward
0 new messages