-
Notifications
You must be signed in to change notification settings - Fork 528
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I’m using Camelot to parse multiple PDFs on Windows 11 with Python 3.13.5. When processing several files, I get a PermissionError related to temporary files. It seems to occur when Camelot tries to clean up temporary directories after reading PDFs.
Exception ignored in atexit callback <function rmtree at 0x...>:
Traceback (most recent call last):
File "C:\Python313\Lib\shutil.py", line 790, in rmtree
return _rmtree_unsafe(path, onexc)
File "C:\Python313\Lib\shutil.py", line 635, in _rmtree_unsafe
onexc(os.rmdir, path, err)
File "C:\Python313\Lib\shutil.py", line 631, in _rmtree_unsafe
os.rmdir(path)
PermissionError: [WinError 5] Access is denied: '<temp_file_path>'
Steps to reproduce the bug
Expected behavior
All PDFs should parse successfully without PermissionError. Temporary files should be cleaned up automatically.
Code
import camelot
from pathlib import Path
import os
PDF_FOLDER = Path(r"C:\path\to\your\pdfs") # replace with actual folder on your system
for pdf in os.listdir(PDF_FOLDER):
pdf_path = PDF_FOLDER / pdf
print(pdf_path)
tables = camelot.read_pdf(
pdf_path,
pages="1",
flavor="lattice"
)sample-tables.pdf
sample-tables_2.pdf
Screenshots
Environment
- OS: Windows-11-10.0.26100-SP0
- Python version: 3.13.5 (tags/v3.13.5:6cb20a2, Jun 11 2025, 16:15:46) [MSC v.1943 64 bit (AMD64)]
- Numpy version: 2.2.6
- OpenCV version: 4.12.0
- Ghostscript version: not installed
- camelot version: 1.0.9
Additional context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working