From 890e6c0715285bbe02da3f472d6436d65589b7c5 Mon Sep 17 00:00:00 2001 From: CplusHua <61106407+CplusHua@users.noreply.github.com> Date: Sat, 14 Oct 2023 07:24:49 -0500 Subject: [PATCH] fix: shell path error python3.10/site-packages/pypandoc/__init__.py", line 164, in convert_file format = _identify_format_from_path(discovered_source_files[0], format) IndexError: list index out of range --- pypandoc/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pypandoc/__init__.py b/pypandoc/__init__.py index c82ca6b..1f237b8 100644 --- a/pypandoc/__init__.py +++ b/pypandoc/__init__.py @@ -161,6 +161,7 @@ def convert_file(source_file:Union[list, str, Path, Generator], to:str, format:U discovered_source_files = [] if isinstance(source_file, str): + source_file = source_file.replace('[', '[[]') discovered_source_files += glob.glob(source_file) if isinstance(source_file, list): # a list of possibly file or file patterns. Expand all with glob for filepath in source_file: