diff options
author | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-09-14 08:14:04 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-09-14 08:14:04 (GMT) |
commit | b626f628eb9966b7017dcc4a9d715a99c01b1f4f (patch) | |
tree | cec94f51e6c7e87beadd6b30df8be2a99357c3f5 /sugar | |
parent | fe39b82a932afd40f96004a106003eb119197737 (diff) |
Fix mime.get_primary_extension().
Diffstat (limited to 'sugar')
-rw-r--r-- | sugar/objects/mime.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sugar/objects/mime.py b/sugar/objects/mime.py index baa014f..08b26b1 100644 --- a/sugar/objects/mime.py +++ b/sugar/objects/mime.py @@ -40,10 +40,13 @@ def get_primary_extension(mime_type): f = open('/etc/mime.types') while True: line = f.readline() + if not line: + break cols = line.replace('\t', ' ').split(' ') if mime_type == cols[0]: for col in cols[1:]: if col: + col = col.replace('\n', '') _extensions_cache[mime_type] = col return col |