Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from docx.api import Document # noqa

__version__ = '0.8.10.36'
__version__ = '0.8.10.37'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt this be 1.1.2

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcpfuller this is a fork of python-docx. The original project is here



# register custom Part classes with opc package reader
Expand Down
7 changes: 7 additions & 0 deletions docx/parts/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ def _footnotes_part(self):
part if one is not present.
"""
try:
# check if in document is used `footnoteReference`.
# If not then load the default footnote part.
# The footnote part xml remains after all the footnotes are deleted,
# so this check is to prevent loading of unused footnotes.
refs = self.document.element.xpath('//w:footnoteReference')
if len(refs) == 0:
raise KeyError
return self.part_related_by(RT.FOOTNOTES)
except KeyError:
footnotes_part = FootnotesPart.default(self.package)
Expand Down