Replace deprecated PyPDF2 with pypdf (#12203)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Graham Neubig
2026-01-02 16:47:52 -05:00
committed by GitHub
parent ee2ad16442
commit 903c047015
3 changed files with 3 additions and 4 deletions

View File

@@ -22,7 +22,7 @@ import base64
from typing import Any
import docx
import PyPDF2
import pypdf
from pptx import Presentation
from pylatexenc.latex2text import LatexNodes2Text
@@ -42,7 +42,7 @@ def parse_pdf(file_path: str) -> None:
file_path: str: The path to the file to open.
"""
print(f'[Reading PDF file from {file_path}]')
content = PyPDF2.PdfReader(file_path)
content = pypdf.PdfReader(file_path)
text = ''
for page_idx in range(len(content.pages)):
text += (