fix(deps): upgrade PyPDF2 to pypdf >= 3.9.0 to fix CVE-2023-36464

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-12 02:52:17 +00:00
parent 0c2e308790
commit cc98039246
10 changed files with 31 additions and 31 deletions
+3 -3
View File
@@ -460,7 +460,7 @@ def reprocess_with_cloud_ocr(request: Request, file_id: int, db: DbSession):
def _extract_text_from_pdf(file_path: str) -> str:
"""
Extract text from a PDF file using PyPDF2.
Extract text from a PDF file using pypdf.
Args:
file_path: Path to the PDF file
@@ -468,11 +468,11 @@ def _extract_text_from_pdf(file_path: str) -> str:
Returns:
Extracted text from all pages
"""
import PyPDF2
import pypdf # Upgraded from PyPDF2 to fix CVE-2023-36464
extracted_text = ""
with open(file_path, "rb") as f:
pdf_reader = PyPDF2.PdfReader(f)
pdf_reader = pypdf.PdfReader(f)
for page in pdf_reader.pages:
extracted_text += page.extract_text() + "\n"
return extracted_text