classification
Title: MIME type for *.zip becomes application/x-zip-compressed on Windows
Type: behavior Stage: resolved
Components: Windows Versions: Python 3.8
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: danny87105, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2020-09-07 15:45 by danny87105, last changed 2020-09-28 20:57 by steve.dower. This issue is now closed.

Messages (2)
msg376508 - (view) Author: Danny Lin (danny87105) Date: 2020-09-07 15:45
On Windows, command "python -m mimetypes foo.zip" outputs "type: application/x-zip-compressed encoding: None", while it's "type: application/zip encoding: None" on Linux.

According to the mimetype.py in CPython source code, the MIME type for '.zip' is 'application/zip'. It seems to be overwritten somewhere on Windows.
msg377628 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2020-09-28 20:57
mimetype uses the system database for MIME types, which on Windows is application/x-zip-compressed, so this is by design.

If you have a need to specify a MIME type that does not match the system you're on, you'll need your own logic.
History
Date User Action Args
2020-09-28 20:57:07steve.dowersetstatus: open -> closed
resolution: not a bug
messages: + msg377628

stage: resolved
2020-09-07 15:45:21danny87105create