From 0eb8a29da9904a0e1b4c29de8464fe7dadb775dc Mon Sep 17 00:00:00 2001 From: Tanay Soni Date: Mon, 6 Jul 2020 16:56:10 +0200 Subject: [PATCH] Adjust PDF conversion subprocess for Python v3.6 (#194) --- haystack/indexing/file_converters/pdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haystack/indexing/file_converters/pdf.py b/haystack/indexing/file_converters/pdf.py index 493f28ac6..170ea14f6 100644 --- a/haystack/indexing/file_converters/pdf.py +++ b/haystack/indexing/file_converters/pdf.py @@ -128,7 +128,7 @@ class PDFToTextConverter(BaseConverter): command = ["pdftotext", "-layout", str(file_path), "-"] else: 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") pages = document.split("\f") pages = pages[:-1] # the last page in the split is always empty.