[FIX]: Closes Popen descriptors in document.
bzr revid: atp@tinyerp.co.in-20101207120525-2825qhtdbo6kgk0v
This commit is contained in:
parent
f981dd322d
commit
1ee15503f4
|
@ -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())
|
||||
|
||||
|
|
Loading…
Reference in New Issue