From c24ab97c52d8ac1759c47cbe5d01eedfcded33fc Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 18 May 2017 16:33:10 +0200 Subject: [PATCH] [FIX] P3: bytes.startswith(bytes) --- addons/document/models/ir_attachment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/document/models/ir_attachment.py b/addons/document/models/ir_attachment.py index 7e1afe36e4e..2bc6aee234d 100644 --- a/addons/document/models/ir_attachment.py +++ b/addons/document/models/ir_attachment.py @@ -93,7 +93,7 @@ class IrAttachment(models.Model): '''Index PDF documents''' buf = u"" - if bin_data.startswith('%PDF-'): + if bin_data.startswith(b'%PDF-'): f = io.BytesIO(bin_data) try: pdf = PyPDF2.PdfFileReader(f, overwriteWarnings=False)