You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When processing a DOCX file containing lists, the code throws a TypeError due to comparison between an integer and NoneType in the handle_text_elements method of MsWordDocumentBackend. The error occurs when trying to close a list and comparing key with self.level_at_new_list which is None.
Specific error:
TypeError: '>=' not supported between instances of 'int' and 'NoneType'
The issue appears to be in the following code section:
elifnumidisNoneandself.prev_numid() isnotNone: # Close listforkey, valinself.parents.items():
ifkey>=self.level_at_new_list:
self.parents[key] =Noneself.level=self.level_at_new_list-1self.level_at_new_list=None
The conversion fails with the TypeError mentioned above
Docling version
docling 2.15.1
Python version
Python 3.12
The bug appears to be related to list handling logic where self.level_at_new_list is not properly initialized or maintained when processing certain list structures in DOCX files. This needs to be fixed to properly handle the case when self.level_at_new_list is None.
The text was updated successfully, but these errors were encountered:
Bug
When processing a DOCX file containing lists, the code throws a TypeError due to comparison between an integer and NoneType in the
handle_text_elements
method ofMsWordDocumentBackend
. The error occurs when trying to close a list and comparingkey
withself.level_at_new_list
which is None.Specific error:
The issue appears to be in the following code section:
Steps to reproduce
Docling version
Python version
The bug appears to be related to list handling logic where
self.level_at_new_list
is not properly initialized or maintained when processing certain list structures in DOCX files. This needs to be fixed to properly handle the case whenself.level_at_new_list
is None.The text was updated successfully, but these errors were encountered: