diff --git a/bids-validator/bids_validator/bids_validator.py b/bids-validator/bids_validator/bids_validator.py index d8ec7a3bb..846de9d11 100644 --- a/bids-validator/bids_validator/bids_validator.py +++ b/bids-validator/bids_validator/bids_validator.py @@ -1,5 +1,6 @@ """Validation class for BIDS projects.""" import logging +import os import re from functools import lru_cache from itertools import chain @@ -134,6 +135,9 @@ def parse(cls, path): if cls.regexes is None: cls._init_regexes() + if path.startswith(os.sep): + path = path.replace(os.sep, '/') + if not path.startswith('/'): raise ValueError("Path must be relative to root of a BIDS dataset," " and must include a leading forward slash `/`.")