Skip to content

Commit

Permalink
PDF Encrypted Case (#2764)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhongsun96 authored Oct 10, 2024
1 parent f40c5ca commit 85d5e6c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/danswer/file_processing/extract_file_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,9 @@ def read_pdf_file(
# By user request, keep files that are unreadable just so they
# can be discoverable by title.
return "", metadata
else:
logger.warning("No Password available to to decrypt pdf")
elif pdf_reader.is_encrypted:
logger.warning("No Password available to to decrypt pdf, returning empty")
return "", metadata

# Extract metadata from the PDF, removing leading '/' from keys if present
# This standardizes the metadata keys for consistency
Expand Down

0 comments on commit 85d5e6c

Please sign in to comment.