{"record":{"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":"exception","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/5551b5d35f985c99cb8f1af2b3c526b050e4c059/alembic/config.py#L527-L563","documentation":"Config._get_file_separator_char raises ValueError when the path_separator (or deprecated version_path_separator) option in alembic.ini has a value outside the allowed set. The value must be one of 'space', 'newline', 'os', ':', or ';' so Alembic knows how to split multi-value path strings.","triggerScenarios":"Setting path_separator = comma (or any other unsupported token) in the [alembic] section of alembic.ini; using version_locations or prepend_sys_path with a separator value Alembic does not recognize.","commonSituations":"Developers assuming comma is a valid separator; copy-pasting a config snippet from an outdated tutorial; migrating an old config that relied on legacy space/comma splitting and adding a wrong explicit value.","solutions":["Set path_separator to one of the allowed values: 'space', 'newline', 'os', ':', or ';' (os uses the platform separator).","Remove the path_separator line entirely to get the legacy deprecation warning rather than a hard error.","Use 'os' for cross-platform path lists matching the OS path separator."],"exampleFix":"# before (alembic.ini)\npath_separator = comma\n\n# after\npath_separator = os","handlingStrategy":"validation","validationCode":"ALLOWED = {'space', 'newline', 'os', ':', ';'}\nvalue = config.get_main_option('path_separator')\nif value is not None and value not in ALLOWED:\n    raise ValueError(f'Invalid path_separator: {value}; allowed: {ALLOWED}')","typeGuard":"def is_valid_separator(value: str) -> bool:\n    return value in {'space', 'newline', 'os', ':', ';'}","tryCatchPattern":null,"preventionTips":["Use 'os' for cross-platform path lists in alembic.ini.","Validate alembic.ini in a config-check CI step after edits.","Omit path_separator to rely on documented defaults rather than guessing values."],"tags":["config","alembic-ini","path-separator","configuration"],"backgroundTag":null,"analyzedSha":"5551b5d35f985c99cb8f1af2b3c526b050e4c059","analyzedAt":"2026-08-11T01:38:46.612Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}