Skip to content

Docling failing word doc with no comments #2955

@joe-pierce

Description

@joe-pierce

Bug

Converting a word doc fails with AttributeError

Steps to reproduce

Convert a word doc that has no comments.

Get the following error traceback:

Traceback (most recent call last):
   File ".venv\Lib\site-packages\docling\pipeline\base_pipeline.py", line 75, in execute
     conv_res = self._build_document(conv_res)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File ".venv\Lib\site-packages\docling\pipeline\simple_pipeline.py", line 40, in _build_document
     conv_res.document = conv_res.input._backend.convert()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File ".venv\Lib\site-packages\docling\backend\msword_backend.py", line 169, in convert
     self._add_comments(self.docx_obj, doc)
   File ".venv\Lib\site-packages\docling\backend\msword_backend.py", line 1772, in _add_comments
     target.comments.append(group_ref)
     ^^^^^^^^^^^^^^^
   File ".venv\Lib\site-packages\pydantic\main.py", line 1026, in __getattr__
     raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}')
 AttributeError: 'GroupItem' object has no attribute 'comments'

Docling version

2.72.0

Python version

3.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions