From b4bf839a132c7d01f8aac0333710d5f4efb72a40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20de=20Saint=20Martin?= <cedric.dsm@tiolive.com> Date: Fri, 16 May 2014 13:13:00 +0000 Subject: [PATCH] [ERP5 product] PyPDF2 uses asserts which can raise AssertionError in case PDF format is broken. --- product/ERP5/Document/PDFDocument.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product/ERP5/Document/PDFDocument.py b/product/ERP5/Document/PDFDocument.py index d74b83f17a..7e1dc3bc95 100644 --- a/product/ERP5/Document/PDFDocument.py +++ b/product/ERP5/Document/PDFDocument.py @@ -329,7 +329,7 @@ class PDFDocument(Image): self.getRelativeUrl(), info_key, info_value)) else: result.setdefault(info_key, info_value) - except PdfReadError: + except (PdfReadError, AssertionError): LOG("PDFDocument.getContentInformation", PROBLEM, "PyPDF2 is Unable to read PDF, probably corrupted PDF here : %s" % \ (self.getRelativeUrl(),)) -- 2.30.9