Description
Hello,
I found another bug, this time using this pdf: CR-14iA-Flyer-DE.pdf
A PermissionError stops the execution. However it only occurs if I call utils.get_page_layout() before read_pdf() is called. Additionally the error doesn't occur when I run the code using the debugger of PyCharm. It just appears on normal execution.
Traceback (most recent call last):
File ".../test.py", line 7, in <module>
table = camelot.read_pdf(file, flavor="stream", pages="2")
File "...\venv\lib\site-packages\camelot\io.py", line 113, in read_pdf
tables = p.parse(
File "...\venv\lib\site-packages\camelot\handlers.py", line 174, in parse
tables.extend(t)
File "...\venv\lib\site-packages\camelot\utils.py", line 144, in __exit__
shutil.rmtree(self.name)
File "C:\Users\Patrick\AppData\Local\Programs\Python\Python38\lib\shutil.py", line 737, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Users\Patrick\AppData\Local\Programs\Python\Python38\lib\shutil.py", line 615, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\Users\Patrick\AppData\Local\Programs\Python\Python38\lib\shutil.py", line 613, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\Patrick\\AppData\\Local\\Temp\\tmp2rqr4kg1\\p-2_rotated.pdf'
Code:
import camelot
from camelot import utils
file = "CR-14iA-Flyer-DE.pdf"
layout, dim = utils.get_page_layout(file)
table = camelot.read_pdf(file, flavor="stream", pages="2")
Version information:
Windows-10-10.0.19041-SP0
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)]
NumPy 1.19.1
OpenCV 4.3.0
Camelot 0.8.1
Metadata
Metadata
Assignees
Labels
No labels