camelot-dev / camelot-dev/excalibur

ERROR:root:file has not been decrypted

Open
#22 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.8k
Forks
238
PR merge metrics
No merged PRs in 30d

Description

While trying to upload a pdf file following error is through.

ERROR:root:file has not been decrypted
Traceback (most recent call last):
File "c:\py3\lib\site-packages\excalibur\tasks.py", line 57, in split
save_page(file.filepath, file.page_number)
File "c:\py3\lib\site-packages\excalibur\utils\task.py", line 10, in save_page
page = infile.getPage(page_number - 1)
File "c:\py3\lib\site-packages\PyPDF2\pdf.py", line 1176, in getPage
self._flatten()
File "c:\py3\lib\site-packages\PyPDF2\pdf.py", line 1505, in _flatten
catalog = self.trailer["/Root"].getObject()
File "c:\py3\lib\site-packages\PyPDF2\generic.py", line 516, in __getitem__
return dict.__getitem__(self, key).getObject()
File "c:\py3\lib\site-packages\PyPDF2\generic.py", line 178, in getObject
return self.pdf.getObject(self).getObject()
File "c:\py3\lib\site-packages\PyPDF2\pdf.py", line 1617, in getObject
raise utils.PdfReadError("file has not been decrypted")
PyPDF2.utils.PdfReadError: file has not been decrypted

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the upload with the encrypted PDF and inspect the traceback locations in excalibur/tasks.py and excalibur/utils/task.py, especially split and save_page. Check how PyPDF2 handles the file before getPage is called. The issue does not define the expected behavior after detecting an undecrypted file, so the completion criteria need clarification.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.