From 560b296a3b58f81a48da386deaf73f52c4890632 Mon Sep 17 00:00:00 2001 From: "Sanjay Gohel (Open ERP)" Date: Mon, 19 Dec 2011 15:01:56 +0530 Subject: [PATCH] [FIX]Bug:bug fix and set error message for doc type files bzr revid: sgo@tinyerp.com-20111219093156-yern0qjj3vz7gpsf --- addons/document/std_index.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/addons/document/std_index.py b/addons/document/std_index.py index fe42cfb1795..a110d302fcb 100644 --- a/addons/document/std_index.py +++ b/addons/document/std_index.py @@ -95,9 +95,15 @@ class DocIndex(indexer): return ['.doc'] def _doIndexFile(self,fname): - pop = Popen(['antiword', fname], shell=False, stdout=PIPE) - (data, _) = pop.communicate() - return _to_unicode(data) + try: + pop = Popen(['antiword', fname], shell=False, stdout=PIPE) + (data, _) = pop.communicate() + return _to_unicode(data) + except: + import netsvc + logger = netsvc.Logger() + logger.notifyChannel("document", netsvc.LOG_ERROR, 'Please install Antiword package(MS Word reader): sudo apt-get install antiword') + return False cntIndex.register(DocIndex())