10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-11-03 20:53:59 +01:00

fileName check in toFile method

This commit is contained in:
Mickaël Véril 2021-03-27 15:49:53 +01:00 committed by Anthony Scemama
parent d46e0af490
commit 56b4ff0435

View File

@ -219,6 +219,8 @@ class dataFileBase(object):
if suffix: if suffix:
fileNameComp.append(suffix) fileNameComp.append(suffix)
fileName="_".join(fileNameComp).replace(" ","_")+".dat" 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 file=subpath/fileName
if not file.exists(): if not file.exists():
with file.open("w") as f: with file.open("w") as f: