mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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!)
This commit is contained in:
parent
360e031f8d
commit
c019ecb7fe
1 changed files with 2 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue