Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-09-14 08:14:04 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-09-14 08:14:04 (GMT)
commitb626f628eb9966b7017dcc4a9d715a99c01b1f4f (patch)
treecec94f51e6c7e87beadd6b30df8be2a99357c3f5 /sugar
parentfe39b82a932afd40f96004a106003eb119197737 (diff)
Fix mime.get_primary_extension().
Diffstat (limited to 'sugar')
-rw-r--r--sugar/objects/mime.py3
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