Skip to content

load_directory aborts entire batch if one PDF fails to parse #1

Description

@Nabil-Haddad

Current behavior

load_directory() in src/Process.py calls load_pdf(filepath) for each file with no error handling. If a single PDF is corrupted, password-protected,
or otherwise unreadable by PyMuPDF, fitz.open() raises an exception, and the exception propagates all the way up through load_directory, killing the run, even though the other files in the directory would have processed fine.

Expected behavior

A single bad file should be skipped (with a warning logged) so the rest of the directory is still processed. The pipeline is meant to run over a
whole corpus; one bad input shouldn't take down the batch.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions