summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorxmo-odoo <xmo@odoo.com>2017-05-12 13:28:57 +0200
committerGitHub <noreply@github.com>2017-05-12 13:28:57 +0200
commit021de21e8cdcf35276c945d8070d04435fa1a19c (patch)
tree31ef4648e367fa6b5bc54d97f4aa1774a7deaf88 /addons
parent13ee5596c6dd32b3471ce705b62b54ea59c00431 (diff)
[FIX] P3: replace PyPDF by PyPDF2
PyPDF is unmaintained and abandoned (as noted on its home page http://pybrary.net/pyPdf/) and was never updated to Python 3. PyPDF2 is a fork which provides a mostly compatible API and is P3-compatible. Replace PyPDF by PyPDF2.
Diffstat (limited to 'addons')
-rw-r--r--addons/document/models/ir_attachment.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/document/models/ir_attachment.py b/addons/document/models/ir_attachment.py
index 7480a657ff6..53ae1f1f463 100644
--- a/addons/document/models/ir_attachment.py
+++ b/addons/document/models/ir_attachment.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
-import pyPdf
+import PyPDF2
import xml.dom.minidom
import zipfile
@@ -110,7 +110,7 @@ class IrAttachment(models.Model):
if bin_data.startswith('%PDF-'):
f = StringIO(bin_data)
try:
- pdf = pyPdf.PdfFileReader(f)
+ pdf = PyPDF2.PdfFileReader(f, overwriteWarnings=False)
for page in pdf.pages:
buf += page.extractText()
except Exception: