Skip to content

Remove threaded pdf parsing #978

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions paperqa/readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ async def read_doc(

# start with parsing -- users may want to store this separately
if str_path.endswith(".pdf"):
# TODO: Make parse_pdf_to_pages async
parsed_text = await asyncio.to_thread(parse_pdf_to_pages, path, **parser_kwargs)
# pymupdf is not thread-safe per docs here: https://pymupdf.readthedocs.io/en/latest/recipes-multiprocessing.html
parsed_text = parse_pdf_to_pages(path, **parser_kwargs)
elif str_path.endswith(".txt"):
# TODO: Make parse_text async
parser_kwargs.pop("use_block_parsing", None) # Not a parse_text kwarg
Expand Down