[ python-Feature Requests-1043134 ] mimetypes.guess_extension('text/plain') == '.ksh' ???

SourceForge.net noreply at sourceforge.net
Mon Oct 11 22:15:48 CEST 2004


Feature Requests item #1043134, was opened at 2004-10-08 17:44
Message generated for change (Settings changed) made by jlgijsbers
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1043134&group_id=5470

>Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Robert Kiendl (kxroberto)
Assigned to: Nobody/Anonymous (nobody)
Summary: mimetypes.guess_extension('text/plain') == '.ksh' ???

Initial Comment:
Instead of returning the first in the list of
extensions it should return the most reasonable . here:
to have a *.txt on disk after saveing?



----------------------------------------------------------------------

Comment By: Johannes Gijsbers (jlgijsbers)
Date: 2004-10-11 22:15

Message:
Logged In: YES 
user_id=469548

common_types is for adding some non-standard types, not for
determining which extension is most reasonable. I'll be
happy to look at a decent patch, but I'm moving this to
feature request until then.

----------------------------------------------------------------------

Comment By: Robert Kiendl (kxroberto)
Date: 2004-10-10 10:44

Message:
Logged In: YES 
user_id=972995

in mimetypes.py there is already a

common_types = {
    '.jpg' : 'image/jpg',
...

.txt could be added,
mayby guess_extension should first reverse-take it out of
there, not random ...?

background: my intent was to save MIME attachment as
(startable) temporary file. yet got wonderful .ksh's for
textfiles, and had to fumble ...

 


----------------------------------------------------------------------

Comment By: Johannes Gijsbers (jlgijsbers)
Date: 2004-10-09 17:26

Message:
Logged In: YES 
user_id=469548

How would you suggest finding out what the most reasonable
extension for a mime type is?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1043134&group_id=5470


More information about the Python-bugs-list mailing list