ezodf
ezodf copied to clipboard
__detect_mime_type is broken
__detect_mime_type
has a bug in line 66/67:
https://github.com/T0ha/ezodf/blob/f9675c165679290a15bd2f9ab75f90fbc1490668/ezodf/document.py#L56-L68
os.path.splitext
returns the file extension with a leading dot (e. g. .ods
). But MIMETYPES
only contains the extensions without the dot:https://github.com/T0ha/ezodf/blob/f9675c165679290a15bd2f9ab75f90fbc1490668/ezodf/const.py#L23
emmm, This function is introduced by me...
ext = os.path.splitext(file_manager.zipname)[1]
should be
ext = os.path.splitext(file_manager.zipname)[1][1:]
I will create a PR later.