diff options
| author | jvoisin | 2013-04-29 22:56:30 +0200 |
|---|---|---|
| committer | jvoisin | 2013-04-29 22:56:30 +0200 |
| commit | ac82b5fb712cbc0c80d4f6fb7c11bae70eea78e5 (patch) | |
| tree | 56bd5d9c8a22dd967ede07e2a5f7b53fe42293f2 /MAT/mat.py | |
| parent | d7a6ca39fea4d362bf4489349398bb5f81a890a7 (diff) | |
Fix incorrect handling of ziped formats formats
The previous behavior was to use python's mimetype module
on ziped format, to guess what type of file it precisely is.
But sometimes, this fail. This commit fix this corner-case.
Diffstat (limited to 'MAT/mat.py')
| -rw-r--r-- | MAT/mat.py | 3 |
1 files changed, 2 insertions, 1 deletions
| @@ -144,7 +144,8 @@ def create_class_file(name, backup, **kwargs): | |||
| 144 | mime = parser.mime_type | 144 | mime = parser.mime_type |
| 145 | 145 | ||
| 146 | if mime == 'application/zip': # some formats are zipped stuff | 146 | if mime == 'application/zip': # some formats are zipped stuff |
| 147 | mime = mimetypes.guess_type(name)[0] | 147 | if mimetypes.guess_type(name)[0] is not None: |
| 148 | mime = mimetypes.guess_type(name)[0] | ||
| 148 | 149 | ||
| 149 | if mime.startswith('application/vnd.oasis.opendocument'): | 150 | if mime.startswith('application/vnd.oasis.opendocument'): |
| 150 | mime = 'application/opendocument' # opendocument fileformat | 151 | mime = 'application/opendocument' # opendocument fileformat |
