document: even better fix for std_index, which won't leave zombies
As in 342b1f32adacf0a, Popen processes need to be properly exited. bzr revid: p_christ@hol.gr-20101223141744-bbuipsqwqb4wczb5
This commit is contained in:
parent
8e8803e9df
commit
f551479a9b
|
@ -95,8 +95,9 @@ class DocIndex(indexer):
|
|||
return ['.doc']
|
||||
|
||||
def _doIndexFile(self,fname):
|
||||
fp = Popen(['antiword', fname], shell=False, stdout=PIPE).stdout
|
||||
return _to_unicode(fp.read())
|
||||
pop = Popen(['antiword', fname], shell=False, stdout=PIPE)
|
||||
(data, _) = pop.communicate()
|
||||
return _to_unicode(data)
|
||||
|
||||
cntIndex.register(DocIndex())
|
||||
|
||||
|
@ -157,8 +158,9 @@ class PdfIndex(indexer):
|
|||
return ['.pdf']
|
||||
|
||||
def _doIndexFile(self,fname):
|
||||
fp = Popen(['pdftotext', '-enc', 'UTF-8', '-nopgbrk', fname, '-'], shell=False, stdout=PIPE).stdout
|
||||
return _to_unicode( fp.read())
|
||||
pop = Popen(['pdftotext', '-enc', 'UTF-8', '-nopgbrk', fname, '-'], shell=False, stdout=PIPE)
|
||||
(data, _) = pop.communicate()
|
||||
return _to_unicode(data)
|
||||
|
||||
cntIndex.register(PdfIndex())
|
||||
|
||||
|
|
Loading…
Reference in New Issue