summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoratp (Open ERP) <atp@tinyerp.co.in>2010-12-07 17:35:25 +0530
committeratp (Open ERP) <atp@tinyerp.co.in>2010-12-07 17:35:25 +0530
commit1ee15503f4e1ef038d9b4028a6ea9a1beff298c0 (patch)
tree11c3695d0c957ff2c3407d50207430f8887e9ec1
parentf981dd322d2c2e8a707802f610f39042c5822982 (diff)
[FIX]: Closes Popen descriptors in document.
bzr revid: atp@tinyerp.co.in-20101207120525-2825qhtdbo6kgk0v
-rw-r--r--addons/document/std_index.py14
1 files changed, 2 insertions, 12 deletions
diff --git a/addons/document/std_index.py b/addons/document/std_index.py
index 7cfcd36e2dc..ca5b02eef55 100644
--- a/addons/document/std_index.py
+++ b/addons/document/std_index.py
@@ -96,12 +96,7 @@ class DocIndex(indexer):
def _doIndexFile(self,fname):
fp = Popen(['antiword', fname], shell=False, stdout=PIPE).stdout
- try:
- file_data = _to_unicode(fp.read())
- finally:
- fp.close()
-
- return file_data
+ return _to_unicode(fp.read())
cntIndex.register(DocIndex())
@@ -163,12 +158,7 @@ class PdfIndex(indexer):
def _doIndexFile(self,fname):
fp = Popen(['pdftotext', '-enc', 'UTF-8', '-nopgbrk', fname, '-'], shell=False, stdout=PIPE).stdout
- try:
- file_data = _to_unicode( fp.read())
- finally:
- fp.close()
-
- return file_data
+ return _to_unicode( fp.read())
cntIndex.register(PdfIndex())