Closed pHequals7 closed 5 years ago
What version of Python are you using? What version of sarge is installed on your system?
Python : 3.7 sarge : 0.1.5
I assume you meant Python 3.7.0 and sarge 0.1.5 rather than sarge 0.1.5.post0. If so, I can't reproduce the problem with those package versions installed on Linux.
In any case, the exception is being raised in sarge, not python-pdfbox. Can you try running the following code with Python and see if it executes successfully?
import sarge
p = sarge.capture_stdout('hostname')
print(p.stdout.text)
Also was not able to reproduce the error on Windows 10; the unit tests pass.
Hey sorry for the mixup, my sarge version is in fact 0.1.5.post0. And I tried running the sarge code, and the same 'local variable 'p'....' error props up!
So since sarge is causing the problems, any way to overcome this??
Try asking the sarge developer by submitting an issue: https://bitbucket.org/vinay.sajip/sarge
Very likely application PDFBox try to run don't have executable bit set. We've got the same error from sarge in similar situation.
FYI, python-pdfbox doesn't use sarge anymore, so this bug should be moot.
Hey, tried reproducing your started code for extracting text
import pdfbox
pi = pdfbox.PDFBox()
text = pi.extract_text('./reports/sample.pdf')
I'm running python 3.7 Got this errorUnboundLocalError Traceback (most recent call last)