mwilliamson / python-mammoth

Convert Word documents (.docx files) to HTML
BSD 2-Clause "Simplified" License
811 stars 121 forks source link

element.name error #9

Closed matt-erhart closed 8 years ago

matt-erhart commented 8 years ago

I had to change def read to the bellow to get python-mammoth working. It's line 284 in body_xml.

def read(element): if hasattr(element, 'name'): handler = handlers.get(element.name) else: setattr(element, 'name', 'noname') handler = None;

mwilliamson commented 8 years ago

Thanks for the report. Is that happening with all documents, such as a blank document, or just some? If it's happening to just some, would you mind sending across an example?

mwilliamson commented 8 years ago

I've just uploaded an updated version of Mammoth to PyPI which should hopefully fix the issue, could you give it a whirl? In any case, I'd still be interested in seeing the documents that caused the issue though.

matt-erhart commented 8 years ago

I was actually converting a pdf to docx with Word 2016 and then doing the rest in python. I don't have the problem with a simple docx file that I made. Thanks for the update, will check it out.

mwilliamson commented 8 years ago

I think the latest version solves this problem, so closing this issue. Feel free to reopen if that turns out not to be the case.