From 03d660df2522c684e97cfa1cd85015762f856b23 Mon Sep 17 00:00:00 2001 From: Benjamin Bertrand Date: Sun, 16 Apr 2017 18:47:24 +0300 Subject: [PATCH] Debug --- pytex/pytex.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pytex/pytex.py b/pytex/pytex.py index 2fcfb2a..c6b9984 100644 --- a/pytex/pytex.py +++ b/pytex/pytex.py @@ -38,7 +38,7 @@ def feed(template, data, output="", force=0): :param force: Override is the output already exists """ logger.info(f"Getting template {template}") - tpl = texenv.get_template(template) + tpl = texenv.get_template(str(template)) if not output: num = 1 @@ -68,20 +68,20 @@ def pdflatex(latex_file, output_dir=""): If output_dir is not set, it produce it next to the latex file. """ if not output_dir: - output_dir = Path(latex_file).dirname() + output_dir = Path(latex_file).dirname().abspath() compilation = subprocess.Popen( [ "pdflatex", f"-output-directory={output_dir}", - latex_file, + str(latex_file), ], stdout=subprocess.PIPE, stderr=subprocess.PIPE, # shell=True ) - out, err = compilation.communicate() + out, err = compilation.communicate(timeout=5) if err: logger.error(err) if out: