aboutsummaryrefslogtreecommitdiff
path: root/mammoth/docx/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'mammoth/docx/__init__.py')
-rw-r--r--mammoth/docx/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mammoth/docx/__init__.py b/mammoth/docx/__init__.py
index 1ca8cb0..c8f4e6e 100644
--- a/mammoth/docx/__init__.py
+++ b/mammoth/docx/__init__.py
@@ -28,7 +28,7 @@ _namespaces = [
def read(fileobj):
zip_file = zipfile.ZipFile(fileobj)
- body_readers = _body_readers(getattr(fileobj, "name"), zip_file)
+ body_readers = _body_readers(getattr(fileobj, "name", None), zip_file)
return _read_notes(zip_file, body_readers).bind(lambda notes:
_read_document(zip_file, body_readers, notes))
@@ -79,7 +79,7 @@ def _body_readers(document_path, zip_file):
relationships=relationships,
styles=styles,
docx_file=zip_file,
- files=Files(os.path.dirname(document_path)),
+ files=Files(None if document_path is None else os.path.dirname(document_path)),
)
return for_name