diff options
| author | Thibault Delavallée <tde@openerp.com> | 2013-03-15 12:43:38 +0100 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2013-03-15 12:43:38 +0100 |
| commit | 4484a3197ca558341ce595df41ffdc072a8d05d2 (patch) | |
| tree | 160895b3cd052ef5a0661ed2ee02a53494dab207 /addons/document/std_index.py | |
| parent | 4387187b8bdac6223979e9a652b6ef6a19096804 (diff) | |
| parent | d0f5b28bd0da703e3d5a23cb68db91a6a87482dc (diff) | |
[MERGE] Sync with trunk, resolved conflicts due to forward port of 7.0
bzr revid: tde@openerp.com-20130315114338-54scb00rkp7zwr30
Diffstat (limited to 'addons/document/std_index.py')
| -rw-r--r-- | addons/document/std_index.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/addons/document/std_index.py b/addons/document/std_index.py index b20874e72f8..dda776b1ec3 100644 --- a/addons/document/std_index.py +++ b/addons/document/std_index.py @@ -105,7 +105,7 @@ class DocIndex(indexer): _logger.warning("Failed attempt to execute antiword (MS Word reader). Antiword is necessary to index the file %s of MIME type %s. Detailed error available at DEBUG level.", fname, self._getMimeTypes()[0]) _logger.debug("Trace of the failed file indexing attempt.", exc_info=True) - return False + return u'' cntIndex.register(DocIndex()) @@ -166,9 +166,14 @@ class PdfIndex(indexer): return ['.pdf'] def _doIndexFile(self, fname): - pop = Popen(['pdftotext', '-enc', 'UTF-8', '-nopgbrk', fname, '-'], shell=False, stdout=PIPE) - (data, _) = pop.communicate() - return _to_unicode(data) + try: + pop = Popen(['pdftotext', '-enc', 'UTF-8', '-nopgbrk', fname, '-'], shell=False, stdout=PIPE) + (data, _) = pop.communicate() + return _to_unicode(data) + except OSError: + _logger.warning("Failed attempt to execute pdftotext. This program is necessary to index the file %s of MIME type %s. Detailed error available at DEBUG level.", fname, self._getMimeTypes()[0]) + _logger.debug("Trace of the failed file indexing attempt.", exc_info=True) + return u'' cntIndex.register(PdfIndex()) |
