Fix incorrect check for spaces in current execution folder (only check in cache folders)

This commit is contained in:
allegroai 2020-09-15 20:26:02 +03:00
parent 6a24da2849
commit 28f47419b0
2 changed files with 3 additions and 3 deletions

View File

@ -672,7 +672,7 @@ class Worker(ServiceCommandSection):
def check(self, **_): def check(self, **_):
try: try:
check_directory_path(str(Path(".").resolve())) check_directory_path(str(Path(".").resolve()), check_whitespace_in_path=False)
except OSError as e: except OSError as e:
if e.errno == errno.ENOENT: if e.errno == errno.ENOENT:
raise CommandFailedError("current working directory does not exist") raise CommandFailedError("current working directory does not exist")

View File

@ -459,9 +459,9 @@ def chain_map(*args):
return reduce(lambda x, y: x.update(y) or x, 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 "{}": {}' 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) match = re.search(r'\s', path)
if match: if match:
raise CommandFailedError( raise CommandFailedError(