[Python-Dev] mimetypes patch #554192
Martin v. Loewis
01 Sep 2002 23:25:39 +0200
Walter D=F6rwald <email@example.com> writes:
> >>Even better would be, if we could assign priorities to the mappings,
> >>so that for e.g. image/jpeg the preferred extension is .jpeg.
> >>Then guess_type() and guess_extension() would return the preferred
> > Do you have a specific application for that in mind? It sounds like
> > overkill.
> I'm using a web mirror script which uses the extensions from
> guess_extension to save all downloaded resources, and I hate it
> when the HTML files are named .htm and JPEG images are named .jpe.
Then this is your preference - others might prefer jpg, just because
their file system can deal better with that. If you can agree that
this is your preference, you should put the preference mechanism into
Maybe your preference can be expressed algorithmically? It might be
that you always want the longest known extension (it is unlikely that
you prefer "jpeg" over "jpg" just because that contains a vowel :-).