{"id":"ef0221d54e664ac3","repo":"python-poetry/poetry","slug":"you-can-only-pass-one-value","errorCode":null,"errorMessage":"You can only pass one value.","messagePattern":"You can only pass one value\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/poetry/console/commands/config.py","lineNumber":379,"sourceCode":"                    )\n\n            config.config_source.add_property(key, settings)\n\n            return 0\n\n        raise ValueError(f\"Setting {self.argument('key')} does not exist\")\n\n    def _handle_single_value(\n        self,\n        source: ConfigSource,\n        key: str,\n        callbacks: tuple[Any, Any],\n        values: list[Any],\n    ) -> int:\n        validator, normalizer = callbacks\n\n        if len(values) > 1:\n            raise RuntimeError(\"You can only pass one value.\")\n\n        value = values[0]\n        if not validator(value):\n            raise RuntimeError(f'\"{value}\" is an invalid value for {key}')\n\n        source.add_property(key, normalizer(value))\n\n        return 0\n\n    def _list_configuration(\n        self, config: dict[str, Any], raw: dict[str, Any], k: str = \"\"\n    ) -> None:\n        orig_k = k\n        for key, value in sorted(config.items()):\n            if k + key in self.LIST_PROHIBITED_SETTINGS:\n                continue\n\n            raw_val = raw.get(key)","sourceCodeStart":361,"sourceCodeEnd":397,"githubUrl":"https://github.com/python-poetry/poetry/blob/92b74dcfe348d0e01e14d40d6c1fa47a4ee04a54/src/poetry/console/commands/config.py#L361-L397","documentation":"RuntimeError from `_handle_single_value` (config.py:378-379) when a single-valued config key receives more than one positional value. Several settings (e.g. `virtualenvs.create`, `installer.parallel`, `requests.max-retries`) accept exactly one value; extras are rejected.","triggerScenarios":"Running `poetry config virtualenvs.create true false` or any single-value key with two or more tokens.","commonSituations":"Append-style mistakes (assuming Poetry merges values); shell glob expanding to multiple tokens; copy-paste errors.","solutions":["Pass only one value: `poetry config virtualenvs.create true`.","Quote any value that might word-split.","For list-valued settings use the appropriate list normalizer key (e.g. `installer.no-binary`)."],"exampleFix":"# before\npoetry config installer.parallel true false\n# after\npoetry config installer.parallel true","handlingStrategy":"validation","validationCode":"values = args_after_key\nif len(values) > 1:\n    raise SystemExit(f\"expected a single value, got {len(values)}: {values}\")","typeGuard":"def is_at_most_one(values: list[str]) -> bool:\n    return isinstance(values, list) and len(values) <= 1","tryCatchPattern":null,"preventionTips":["Check token count before invoking `poetry config`.","Avoid shell constructs that may word-split a value.","Use the list-type settings (`installer.no-binary`) when multiple values are needed."],"tags":["config","cli-args","validation"],"analyzedSha":"92b74dcfe348d0e01e14d40d6c1fa47a4ee04a54","analyzedAt":"2026-08-04T20:33:34.072Z","schemaVersion":2}