[Erp5-report] r21218 - /erp5/trunk/products/ERP5/Document/PDFDocument.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu May 29 13:49:23 CEST 2008


Author: jerome
Date: Thu May 29 13:49:23 2008
New Revision: 21218

URL: http://svn.erp5.org?rev=21218&view=rev
Log:
if the PDF is empty, do not convert

Modified:
    erp5/trunk/products/ERP5/Document/PDFDocument.py

Modified: erp5/trunk/products/ERP5/Document/PDFDocument.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/PDFDocument.py?rev=21218&r1=21217&r2=21218&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/PDFDocument.py (original)
+++ erp5/trunk/products/ERP5/Document/PDFDocument.py Thu May 29 13:49:23 2008
@@ -126,6 +126,8 @@
     """
       Convert the PDF text content to text with pdftotext
     """
+    if not self.data:
+      return ''
     tmp = tempfile.NamedTemporaryFile()
     tmp.write(_unpackData(self.data))
     tmp.seek(0)
@@ -144,6 +146,8 @@
     NOTE: XXX check that command exists and was executed
     successfully
     """
+    if not self.data:
+      return ''
     tmp = tempfile.NamedTemporaryFile()
     tmp.write(_unpackData(self.data))
     tmp.seek(0)




More information about the Erp5-report mailing list