From 28f47419b06a9b67a92dbee16a145a4a42c30015 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Tue, 15 Sep 2020 20:26:02 +0300 Subject: [PATCH] Fix incorrect check for spaces in current execution folder (only check in cache folders) --- trains_agent/commands/worker.py | 2 +- trains_agent/helper/base.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/trains_agent/commands/worker.py b/trains_agent/commands/worker.py index dfe8ee0..0155de4 100644 --- a/trains_agent/commands/worker.py +++ b/trains_agent/commands/worker.py @@ -672,7 +672,7 @@ class Worker(ServiceCommandSection): def check(self, **_): try: - check_directory_path(str(Path(".").resolve())) + check_directory_path(str(Path(".").resolve()), check_whitespace_in_path=False) except OSError as e: if e.errno == errno.ENOENT: raise CommandFailedError("current working directory does not exist") diff --git a/trains_agent/helper/base.py b/trains_agent/helper/base.py index 6d022f7..79b1a10 100644 --- a/trains_agent/helper/base.py +++ b/trains_agent/helper/base.py @@ -459,9 +459,9 @@ def chain_map(*args): return reduce(lambda x, y: x.update(y) or x, args, {}) -def check_directory_path(path): +def check_directory_path(path, check_whitespace_in_path=True): message = 'Could not create directory "{}": {}' - if not is_windows_platform(): + if not is_windows_platform() and check_whitespace_in_path: match = re.search(r'\s', path) if match: raise CommandFailedError(