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

SourceForge.net noreply at sourceforge.net
Mon Aug 23 10:16:36 CEST 2004


Bugs item #1014022, was opened at 2004-08-23 03:39
Message generated for change (Settings changed) made by doerwalter
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: Walter Dörwald (doerwalter)
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: Walter Dörwald (doerwalter)
Date: 2004-08-23 10:15

Message:
Logged In: YES 
user_id=89016

The problem with the bogus self parameter has already been 
fixed in CVS (both on the trunk (revision 1.30) and on the 
maintainance branch (revision 1.28.8.2 which went into 
release 2.3.4). The global add_type() *does* call init(). Can 
you check whether your problem is gone with 2.3.4?

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

Comment By: Cliff Wells (cliffwells18)
Date: 2004-08-23 03: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