Bad bug: the MimeTypes.readfp() was supposed to take a file object as a
authorFred Drake <fdrake@acm.org>
Thu, 16 Aug 2001 15:54:28 +0000 (15:54 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 16 Aug 2001 15:54:28 +0000 (15:54 +0000)
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!)

Lib/mimetypes.py

index 402a1d08ab9e11773f2d5048cf8383da49c2094e..f7c4a7609af34da4b9a64b0eda69049381a920e9 100644 (file)
@@ -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()