__detect_mime_type has a bug in line 66/67:
|
def __detect_mime_type(file_manager): |
|
mime_type = file_manager.get_text('mimetype') |
|
if mime_type is not None: |
|
return mime_type |
|
# Fall-through to next mechanism |
|
entry = file_manager.manifest.find('/') |
|
if entry is not None: |
|
mime_type = entry.get(CN('manifest:media-type')) |
|
else: |
|
# use file ext name |
|
ext = os.path.splitext(file_manager.zipname)[1] |
|
mime_type = MIMETYPES[ext] |
|
return mime_type |
os.path.splitext returns the file extension with a leading dot (e. g. .ods). But MIMETYPES only contains the extensions without the dot:
|
'ots': "application/vnd.oasis.opendocument.spreadsheet-template", |
__detect_mime_typehas a bug in line 66/67:ezodf/ezodf/document.py
Lines 56 to 68 in f9675c1
os.path.splitextreturns the file extension with a leading dot (e. g..ods). ButMIMETYPESonly contains the extensions without the dot:ezodf/ezodf/const.py
Line 23 in f9675c1