ezodf icon indicating copy to clipboard operation
ezodf copied to clipboard

__detect_mime_type is broken

Open weddige opened this issue 2 years ago • 1 comments

__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

weddige avatar Nov 16 '22 10:11 weddige

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.

kenchou avatar Nov 22 '22 20:11 kenchou