summaryrefslogtreecommitdiff
path: root/mammoth
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2018-01-23 21:32:52 +0000
committerMichael Williamson <mike@zwobble.org>2018-01-23 21:32:52 +0000
commitf9e169de5b83a487263c8970872f222401d66765 (patch)
tree78bda240f025f9038a988cd1b5706589356867b9 /mammoth
parent41000ecae3f59c8e766b83b4dfc2e67467eef00f (diff)
Use word/document.xml as fallback
Diffstat (limited to 'mammoth')
-rw-r--r--mammoth/docx/__init__.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mammoth/docx/__init__.py b/mammoth/docx/__init__.py
index c4c6877..326c85b 100644
--- a/mammoth/docx/__init__.py
+++ b/mammoth/docx/__init__.py
@@ -70,10 +70,11 @@ def _read_document(zip_file, body_readers, notes, comments):
def _find_document_filename(zip_file, relationships):
- targets = ["word/document.xml"] + [
+ office_document_type = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"
+ targets = [
target.lstrip("/")
- for target in relationships.find_targets_by_type("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument")
- ]
+ for target in relationships.find_targets_by_type(office_document_type)
+ ] + ["word/document.xml"]
valid_targets = list(filter(lambda target: zip_file.exists(target), targets))
if len(valid_targets) == 0:
return None