diff --git a/component/egg-patch/PyPDF2/0002-fix-pdf-reader-getting-stuck-when-trying-to-read-lar.patch b/component/egg-patch/PyPDF2/0002-fix-pdf-reader-getting-stuck-when-trying-to-read-lar.patch new file mode 100644 index 0000000000000000000000000000000000000000..9ab1c172ac08fb81892c7b1ccdfb2255e23c9121 --- /dev/null +++ b/component/egg-patch/PyPDF2/0002-fix-pdf-reader-getting-stuck-when-trying-to-read-lar.patch @@ -0,0 +1,41 @@ +From f0913cee83b897a58c150911ab9e8ed8c605c472 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> +Date: Wed, 1 Nov 2023 09:44:23 +0100 +Subject: [PATCH] fix pdf reader getting stuck when trying to read large files + wihhout xref marker #808 + +Backport of a PyPDF commit +--- + PyPDF2/pdf.py | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/PyPDF2/pdf.py b/PyPDF2/pdf.py +index 7bba1c6..0034c90 100644 +--- a/PyPDF2/pdf.py ++++ b/PyPDF2/pdf.py +@@ -1919,7 +1919,7 @@ class PdfFileReader(object): + def readNextEndLine(self, stream): + debug = False + if debug: print(">>readNextEndLine") +- line = b_("") ++ line_parts = [] + while True: + # Prevent infinite loops in malformed PDFs + if stream.tell() == 0: +@@ -1946,10 +1946,11 @@ class PdfFileReader(object): + break + else: + if debug: print(" x is neither") +- line = x + line ++ line_parts.append(x) + if debug: print((" RNEL line:", line)) + if debug: print("leaving RNEL") +- return line ++ line_parts.reverse() ++ return b"".join(line_parts) + + def decrypt(self, password): + """ +-- +2.39.2 + diff --git a/component/ghostscript/buildout.cfg b/component/ghostscript/buildout.cfg index 76660b91ebb83d6a8f0187a335003237b41a4ad9..13a881c5bcdd292b63d96b3c74162a7cbb227fca 100644 --- a/component/ghostscript/buildout.cfg +++ b/component/ghostscript/buildout.cfg @@ -16,8 +16,8 @@ parts = ghostscript [ghostscript] recipe = slapos.recipe.cmmi shared = true -url = https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs10020/ghostscript-10.02.0.tar.xz -md5sum = 80c1cdfada72f2eb5987dc0d590ea5b2 +url = https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs10021/ghostscript-10.02.1.tar.xz +md5sum = 26c0cbfa2e09da97f1fc78728048ada8 pkg_config_depends = ${libidn:location}/lib/pkgconfig:${libtiff:location}/lib/pkgconfig:${libjpeg:location}/lib/pkgconfig:${fontconfig:location}/lib/pkgconfig:${fontconfig:pkg_config_depends} # XXX --with-tessdata work arounds a slaprunner bug of having softwares installed in a path containing // configure-options = diff --git a/stack/erp5/buildout.cfg b/stack/erp5/buildout.cfg index 72ac1101d54632dd1e2034d6aa80f7bb855b7298..0f30045d4e26a07de1a32cccbc88da1e74eb2753 100644 --- a/stack/erp5/buildout.cfg +++ b/stack/erp5/buildout.cfg @@ -690,7 +690,9 @@ Products.CMFCore-patches = ${:_profile_base_location_}/../../component/egg-patch Products.CMFCore-patch-options = -p1 Products.DCWorkflow-patches = ${:_profile_base_location_}/../../component/egg-patch/Products.DCWorkflow/workflow_method-2.4.1.patch#ec7bb56a9f1d37fcbf960cd1e96e6e6d Products.DCWorkflow-patch-options = -p1 -PyPDF2-patches = ${:_profile_base_location_}/../../component/egg-patch/PyPDF2/0001-Custom-implementation-of-warnings.formatwarning-remo.patch#d25bb0f5dde7f3337a0a50c2f986f5c8 +PyPDF2-patches = + ${:_profile_base_location_}/../../component/egg-patch/PyPDF2/0001-Custom-implementation-of-warnings.formatwarning-remo.patch#d25bb0f5dde7f3337a0a50c2f986f5c8 + ${:_profile_base_location_}/../../component/egg-patch/PyPDF2/0002-fix-pdf-reader-getting-stuck-when-trying-to-read-lar.patch#c06a29b6b6a5df612ae36731b938fb95 PyPDF2-patch-options = -p1 python-magic-patches = ${:_profile_base_location_}/../../component/egg-patch/python_magic/magic.patch#de0839bffac17801e39b60873a6c2068 python-magic-patch-options = -p1 @@ -740,7 +742,7 @@ depends = Acquisition = 4.7+SlapOSPatched001 Products.DCWorkflow = 2.4.1+SlapOSPatched001 ocropy = 1.0+SlapOSPatched001 -PyPDF2 = 1.26.0+SlapOSPatched001 +PyPDF2 = 1.26.0+SlapOSPatched002 pysvn = 1.9.15+SlapOSPatched001 python-ldap = 2.4.32+SlapOSPatched001 python-magic = 0.4.12+SlapOSPatched001