mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-07-19 23:11:03 +00:00
Adjust PDF conversion subprocess for Python v3.6 (#194)
This commit is contained in:
parent
7ada5a91cd
commit
0eb8a29da9
@ -128,7 +128,7 @@ class PDFToTextConverter(BaseConverter):
|
|||||||
command = ["pdftotext", "-layout", str(file_path), "-"]
|
command = ["pdftotext", "-layout", str(file_path), "-"]
|
||||||
else:
|
else:
|
||||||
command = ["pdftotext", str(file_path), "-"]
|
command = ["pdftotext", str(file_path), "-"]
|
||||||
output = subprocess.run(command, capture_output=True, shell=False)
|
output = subprocess.run(command, stdout=subprocess.PIPE, shell=False)
|
||||||
document = output.stdout.decode(errors="ignore")
|
document = output.stdout.decode(errors="ignore")
|
||||||
pages = document.split("\f")
|
pages = document.split("\f")
|
||||||
pages = pages[:-1] # the last page in the split is always empty.
|
pages = pages[:-1] # the last page in the split is always empty.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user