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(