[ python-Bugs-1014022 ] mimetypes add_type has bogus self parameter

SourceForge.net noreply at sourceforge.net
Mon Aug 23 03:48:52 CEST 2004


Bugs item #1014022, was opened at 2004-08-22 18:39
Message generated for change (Comment added) made by cliffwells18
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1014022&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Cliff Wells (cliffwells18)
Assigned to: Nobody/Anonymous (nobody)
Summary: mimetypes add_type has bogus self parameter

Initial Comment:
Python 2.3.3

mimetypes module defines the following function:

def add_type(self, type, ext, strict=True)

This is incorrect as there should be no "self" argument.


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

>Comment By: Cliff Wells (cliffwells18)
Date: 2004-08-22 18:48

Message:
Logged In: YES 
user_id=340357

Actually, the real problem appears to be that
mimetypes.init() isn't called automatically as the
documentation suggests.

import mimetypes
mimetypes.add_type('text/xml', '.rss')

doesn't work but

import mimetypes
mimetypes.init()
mimetypes.add_type('text/xml', '.rss')

does.

From
http://www.python.org/doc/current/lib/module-mimetypes.html:

"The functions described below provide the primary interface
for this module. If the module has not been initialized,
they will call init() if they rely on the information init()
sets up."


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

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


More information about the Python-bugs-list mailing list