From 24d4c4dc70f865b7d1d7d527a8acb4f6e4f84bd5 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 31 Jan 2016 23:01:52 +0530 Subject: [PATCH] pdftotext also need short names --- oml/media/pdf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oml/media/pdf.py b/oml/media/pdf.py index 2ce2b31..dbcb5db 100644 --- a/oml/media/pdf.py +++ b/oml/media/pdf.py @@ -226,6 +226,8 @@ def extract_text(pdf): if sys.platform == 'darwin': cmd = ['/usr/bin/mdimport', '-d2', pdf] else: + if sys.platform == 'win32': + pdf = get_short_path_name(pdf) cmd = ['pdftotext', pdf, '-'] p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = p.communicate()