From: Fred Drake Date: Thu, 16 Aug 2001 15:54:28 +0000 (+0000) Subject: Bad bug: the MimeTypes.readfp() was supposed to take a file object as a X-Git-Tag: v2.2a3~503 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c019ecb7fe7b44fa339defd071510ec2b0728775;p=thirdparty%2FPython%2Fcpython.git Bad bug: the MimeTypes.readfp() was supposed to take a file object as a parameter, but did not. This was found because it can create failures elsewhere based on the presence of mime.types files in some common locations the module searches by default. (I will be writing a test for this module shortly!) --- diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index 402a1d08ab9e..f7c4a7609af3 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -130,11 +130,11 @@ class MimeTypes: self.readfp(fp) fp.close() - def readfp(self): + def readfp(self, fp): """Read a single mime.types-format file.""" map = self.types_map while 1: - line = f.readline() + line = fp.readline() if not line: break words = line.split()