python-openxml / python-docx

Create and modify Word documents with Python
MIT License
4.38k stars 1.08k forks source link

DocumentPart' object has no attribute '_rels'. #1384

Closed theodore86 closed 2 months ago

theodore86 commented 2 months ago

It seems like python-docx has released an new version:

python-docx==1.1.1
docxtpl==0.16.8
uri = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/header'
    def get_headers_footers(self, uri):
>       for relKey, val in self.docx._part._rels.items():
E       AttributeError: 'DocumentPart' object has no attribute '_rels'. Did you mean: 'rels'?
scanny commented 2 months ago

v1.1.2 released this morning includes an accommodation for this, although it should be fixed upstream to use DocumentPart.rels rather than ._rels (which was an implementation detail that changed).