[Python-bugs-list] [ python-Bugs-474583 ] non-standard types in mimetypes.py
noreply@sourceforge.net
noreply@sourceforge.net
Thu, 25 Oct 2001 01:46:59 -0700
Bugs item #474583, was opened at 2001-10-24 11:57
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=474583&group_id=5470
Category: Python Library
Group: Python 2.2
Status: Open
>Resolution: Accepted
Priority: 5
Submitted By: Barry Warsaw (bwarsaw)
>Assigned to: Barry Warsaw (bwarsaw)
Summary: non-standard types in mimetypes.py
Initial Comment:
In the spirit of "be liberal in what you accept", I
think mimetypes should have an option which searches
non-standard but common types. E.g. I just received an
email message which had a content type of image/jpg and
I wanted to store that in a file with the proper
extension. But mimetypes couldn't give that to me
because image/jpeg is the official type.
Attached is a patch to add an optional "strict" flag to
guess_type() and guess_extension(). strict defaults to
1 to keep the current behavior. Set it to 0 and some
additional types are searched. I added back the
non-standard types that Martin removed in revision 1.19
of the file.
This patch also contains a small improvement to the
command line options when this is run as a script. I
can split the patch into two parts if necessary, but I
don't think it is.
----------------------------------------------------------------------
>Comment By: Martin v. Löwis (loewis)
Date: 2001-10-25 01:46
Message:
Logged In: YES
user_id=21627
Sounds good to me, assuming it is also accompanied by a
documentation change. You may also consider adding the types
I rejected from #438790, in particular image/pict, text/xsl
and text/xul (not sure whether any others were rejected).
Back to Barry for checkin.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=474583&group_id=5470