From 71fa375ac07ed23e7105f253fc45fff98890c1c4 Mon Sep 17 00:00:00 2001 From: Paul J Stevens <> Date: Fri, 19 Mar 2010 16:52:22 +0530 Subject: [PATCH] [IMP] document :- Bug #539644 - backward compatibility for file utility bzr revid: ysa@tinyerp.co.in-20100319112222-7k4hv6xbfjh06dnv --- addons/document/content_index.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/document/content_index.py b/addons/document/content_index.py index 9e47621b4c3..a13ba35b60a 100644 --- a/addons/document/content_index.py +++ b/addons/document/content_index.py @@ -158,11 +158,10 @@ class contentIndex(): os.write(fd, content) os.close(fd) - #fp = Popen(['file','-b','--mime-type',fname], shell=False, stdout=PIPE).stdout - fp = Popen(['file','-b',fname], shell=False, stdout=PIPE).stdout + fp = Popen(['file','-b','--mime',fname], shell=False, stdout=PIPE).stdout result = fp.read() fp.close() - mime2 = result.strip() + mime2 = result.split(';')[0] self.__logger.debug('File gave us: %s', mime2) # Note that the temporary file still exists now. mime,fobj = mime_match(mime2, self.mimes)