mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-14 20:23:57 +00:00
fix: Check if sub-directories are actually directories and fail otherwise.
This will explicitly fail if a file (or an invalid symlink) is present. Freqtrade requires these files to be valid files - so failing here is correct behavior. closes #10720
This commit is contained in:
parent
91d9c9b4d5
commit
3dc92b42fe
|
@ -82,6 +82,11 @@ def create_userdata_dir(directory: str, create_dir: bool = False) -> Path:
|
|||
for f in sub_dirs:
|
||||
subfolder = folder / f
|
||||
if not subfolder.is_dir():
|
||||
if subfolder.exists(follow_symlinks=False):
|
||||
raise OperationalException(
|
||||
f"File `{subfolder}` exists already and is not a directory. "
|
||||
"Freqtrade requires this to be a directory."
|
||||
)
|
||||
subfolder.mkdir(parents=False)
|
||||
return folder
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user