ezodf icon indicating copy to clipboard operation
ezodf copied to clipboard

Add support for Flat XML OpenDocumentFormat files

Open jonadem opened this issue 7 years ago • 2 comments

When I try to open a .odt file, I get:

>>> textproc = ezodf.opendoc("foo.fodt")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/ezodf/document.py", line 54, in opendoc
    mime_type = __detect_mime_type(fm)
  File "/usr/local/lib/python2.7/dist-packages/ezodf/document.py", line 69, in __detect_mime_type
    mime_type = MIMETYPES[ext]
KeyError: '.fodt'

Same for .ods files

jonadem avatar Jul 25 '17 21:07 jonadem

I think commit c96fe52dad92d62e3bd9c32e6b64393ec1ea55f8 introduced the issue. Before it checks first if provided file is a zip; after it checks first if filename is not None (and don't reach the flat xml test).

jonadem avatar Jul 26 '17 09:07 jonadem

PR #23 solve the issue.

jonadem avatar Nov 13 '18 12:11 jonadem