From 8c27000f61cd4da2df264450f793a48715cbe51e Mon Sep 17 00:00:00 2001 From: Alejandro Villar Date: Sun, 7 May 2023 11:53:13 +0200 Subject: [PATCH] Skip non-files in batch mode --- ogc/na/ingest_json.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ogc/na/ingest_json.py b/ogc/na/ingest_json.py index 0f54a07..2aaf5d4 100644 --- a/ogc/na/ingest_json.py +++ b/ogc/na/ingest_json.py @@ -651,6 +651,9 @@ def process(input_files: str | Path | Sequence[str | Path], while remaining_fn: fn = str(remaining_fn.popleft()) + if not fn or not os.path.isfile(): + continue + if re.match(r'.*\.ya?ml$', fn): # Context file found, try to find corresponding JSON/JSON-LD file(s) logger.info('Potential YAML context file found: %s', fn)