From 42366c777a5e3011071a28539f9b6a5b29a37bad Mon Sep 17 00:00:00 2001 From: Benjamin Kiessling Date: Mon, 29 Jul 2024 20:26:06 +0200 Subject: [PATCH] Expand ~ to home dir in batch input expression --- kraken/kraken.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kraken/kraken.py b/kraken/kraken.py index 577dfda32..d6f8f8e22 100644 --- a/kraken/kraken.py +++ b/kraken/kraken.py @@ -351,6 +351,7 @@ def process_pipeline(subcommands, input, batch_input, suffix, verbose, format_ty placing their respective outputs in temporary files. """ import glob + import os.path import tempfile from threadpoolctl import threadpool_limits @@ -364,7 +365,8 @@ def process_pipeline(subcommands, input, batch_input, suffix, verbose, format_ty # expand batch inputs if batch_input and suffix: for batch_expr in batch_input: - for in_file in glob.glob(batch_expr, recursive=True): + for in_file in glob.glob(os.path.expanduser(batch_expr), recursive=True): + input.append((in_file, '{}{}'.format(os.path.splitext(in_file)[0], suffix))) # parse pdfs