{"id":"ee9796e9db0872e0","repo":"sqlalchemy/alembic","slug":"s-is-not-a-valid-value-for-s-expected-space","errorCode":null,"errorMessage":"'%s' is not a valid value for %s; expected 'space', 'newline', 'os', ':', ';'","messagePattern":"'(.+?)' is not a valid value for (.+?); expected 'space', 'newline', 'os', ':', ';'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"alembic/config.py","lineNumber":545,"sourceCode":"        for name in names:\n            separator = self.get_main_option(name)\n            if separator is not None:\n                break\n        else:\n            return None\n\n        split_on_path = {\n            \"space\": \" \",\n            \"newline\": \"\\n\",\n            \"os\": os.pathsep,\n            \":\": \":\",\n            \";\": \";\",\n        }\n\n        try:\n            sep = split_on_path[separator]\n        except KeyError as ke:\n            raise ValueError(\n                \"'%s' is not a valid value for %s; \"\n                \"expected 'space', 'newline', 'os', ':', ';'\"\n                % (separator, name)\n            ) from ke\n        else:\n            if name == \"version_path_separator\":\n                util.warn_deprecated(\n                    \"The version_path_separator configuration parameter \"\n                    \"is deprecated; please use path_separator\"\n                )\n            return sep\n\n    def get_version_locations_list(self) -> list[str] | None:\n\n        version_locations_str = self.file_config.get(\n            self.config_ini_section, \"version_locations\", fallback=None\n        )\n","sourceCodeStart":527,"sourceCodeEnd":563,"githubUrl":"https://github.com/sqlalchemy/alembic/blob/44fb3450330204b222ff05135e1fbbbdb28c44db/alembic/config.py#L527-L563","documentation":"Alembic's Config splits the version_locations / path_separator config values using a separator named in alembic.ini. Only 'space', 'newline', 'os' (os.pathsep), ':', and ';' are accepted; anything else cannot be mapped to a split character and raises.","triggerScenarios":"Setting path_separator (or the deprecated version_path_separator) in alembic.ini / the config file to a value outside the allowed set, e.g. path_separator = comma, path_separator = |, or path_separator = ,.","commonSituations":"A user copies a config snippet from a tutorial that used a non-standard separator; a typo in alembic.ini; migrating from an older alembic that only knew version_path_separator.","solutions":["Set path_separator to one of: space, newline, os, :, ;.","Use 'os' to match the host's native path separator.","If you need comma-separated locations, switch to newline-separated (multiline value) which is the most portable."],"exampleFix":"// before\n# alembic.ini\npath_separator = comma\nversion_locations = a,b,c\n// after\n# alembic.ini\npath_separator = newline\nversion_locations =\n    a\n    b\n    c","handlingStrategy":"validation","validationCode":"allowed = {\"space\", \"newline\", \"os\", \":\", \";\"}\nsep = config.get_main_option(\"path_separator\")\nif sep is not None and sep not in allowed:\n    raise ValueError(f\"path_separator must be one of {sorted(allowed)}, got {sep!r}\")","typeGuard":"def is_valid_separator(v) -> bool:\n    return v in {\"space\", \"newline\", \"os\", \":\", \";\"}","tryCatchPattern":null,"preventionTips":["Prefer newline-separated version_locations for portability.","Validate config values at startup, not at run_migrations time.","Avoid the deprecated version_path_separator; use path_separator."],"tags":["configuration","alembic-ini","path-separator"],"analyzedSha":"44fb3450330204b222ff05135e1fbbbdb28c44db","analyzedAt":"2026-08-04T19:57:10.248Z","schemaVersion":2}