You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee=Noneclosed_at=<Date2009-11-15.14:26:22.545>created_at=<Date2009-01-17.08:58:40.600>labels= ['type-feature', 'library']
title='mimetypes on Windows should read MIME database from registry (w/patch)'updated_at=<Date2013-03-23.12:05:36.049>user='https://bugs.python.org/ggenellina'
The mimetypes module has a built-in default database, and, in addition,
reads mime.types files from a list of standard places (/etc/mime.types
On Windows, those files usually don't even present; MIME information is
stored in the registry instead. Until now, the mimetypes module just
ignored those settings; this patch adds support for reading the MIME
database from the Windows registry.
"You see, "MIME\Database\Content Type" in the Windows registry is a mime type -> file extension mapping, *not the other way around*. But read_windows_registry() tries to use it as a file extension -> mime type mapping, and bad things happen, because there are multiple mime types for certain file extensions."
This "enhancement" has basically broken the mimetypes module on windows,
e.g. On my system (windows 7 64 bit, python 3.3)
The expected results are image/png and image/jpeg
I'm having to work around this by calling mimetypes.init(files=) immediately after importing mimetypes to prevent it reading from the registry