From 56b4ff04358200746832c43bc2b4b1455df5824a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Sat, 27 Mar 2021 15:49:53 +0100 Subject: [PATCH] fileName check in toFile method --- tools/lib/data.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/lib/data.py b/tools/lib/data.py index d4ebe836..1edd0d1e 100644 --- a/tools/lib/data.py +++ b/tools/lib/data.py @@ -219,6 +219,8 @@ class dataFileBase(object): if suffix: fileNameComp.append(suffix) fileName="_".join(fileNameComp).replace(" ","_")+".dat" + if os.sep in fileName: + raise ValueError(f"fileName must be a pure file name not a path: {fileName}") file=subpath/fileName if not file.exists(): with file.open("w") as f: