{"record":{"id":"790991a84f3b5bef","repo":"astral-sh/uv","slug":"expected-the-output-filename-to-be-pylock-toml-o","errorCode":null,"errorMessage":"Expected the output filename to be `pylock.toml` or `pylock.<name>.toml`, where `<name>` is non-empty and contains no dots; found `{file_name}`","messagePattern":"Expected the output filename to be `pylock\\.toml` or `pylock\\.<name>\\.toml`, where `<name>` is non-empty and contains no dots; found `(.+?)`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/uv/src/commands/pip/compile.rs","lineNumber":161,"sourceCode":"    let format = format.unwrap_or_else(|| {\n        let extension = output_file.and_then(Path::extension);\n        if extension.is_some_and(|ext| ext.eq_ignore_ascii_case(\"txt\")) {\n            PipCompileFormat::RequirementsTxt\n        } else if extension.is_some_and(|ext| ext.eq_ignore_ascii_case(\"toml\")) {\n            PipCompileFormat::PylockToml\n        } else {\n            PipCompileFormat::RequirementsTxt\n        }\n    });\n\n    // If the user is exporting to PEP 751, ensure the filename matches the specification.\n    if matches!(format, PipCompileFormat::PylockToml) {\n        if let Some(file_name) = output_file\n            .and_then(Path::file_name)\n            .and_then(OsStr::to_str)\n        {\n            if !is_pylock_toml(file_name) {\n                return Err(anyhow!(\n                    \"Expected the output filename to be `pylock.toml` or `pylock.<name>.toml`, where `<name>` is non-empty and contains no dots; found `{file_name}`\",\n                ));\n            }\n        }\n    }\n\n    // Respect `UV_PYTHON`\n    if python.is_none() && python_version.is_none() {\n        if let Ok(request) = std::env::var(EnvVars::UV_PYTHON) {\n            if !request.is_empty() {\n                python = Some(request);\n            }\n        }\n    }\n\n    // If `--python` / `-p` is a simple Python version request, we treat it as `--python-version`\n    // for backwards compatibility. `-p` was previously aliased to `--python-version` but changed to\n    // `--python` for consistency with the rest of the CLI in v0.6.0. Since we assume metadata is","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv/src/commands/pip/compile.rs#L143-L179","documentation":"Error \"Expected the output filename to be `pylock.toml` or `pylock.<name>.toml`, where `<name>` is non-empty and contains no dots; found `{file_name}`\" thrown in astral-sh/uv.","triggerScenarios":"Thrown at crates/uv/src/commands/pip/compile.rs:161 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f1a42680ff5272232d65748acf338b19778dde24","analyzedAt":"2026-08-16T04:51:47.599Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}