{"record":{"id":"e902aa77fcdee8ee","repo":"openai/codex","slug":"path-has-no-parent-directory","errorCode":null,"errorMessage":"path {} has no parent directory","messagePattern":"path (.+?) has no parent directory","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/utils/path-utils/src/lib.rs","lineNumber":124,"sourceCode":"        };\n\n        let next = match next {\n            Ok(path) => path.into_path_buf(),\n            Err(_) => {\n                return Ok(SymlinkWritePaths {\n                    read_path: None,\n                    write_path: root,\n                });\n            }\n        };\n\n        current = next;\n    }\n}\n\npub fn write_atomically(write_path: &Path, contents: &str) -> io::Result<()> {\n    let parent = write_path.parent().ok_or_else(|| {\n        io::Error::new(\n            io::ErrorKind::InvalidInput,\n            format!(\"path {} has no parent directory\", write_path.display()),\n        )\n    })?;\n    std::fs::create_dir_all(parent)?;\n    let mut tmp = NamedTempFile::new_in(parent)?;\n    tmp.write_all(contents.as_bytes())?;\n    tmp.persist(write_path)?;\n    Ok(())\n}\n\nfn normalize_for_wsl(path: PathBuf) -> PathBuf {\n    normalize_for_wsl_with_flag(path, env::is_wsl())\n}\n\nfn normalize_for_native_workdir_with_flag(path: PathBuf, is_windows: bool) -> PathBuf {\n    if is_windows {\n        dunce::simplified(&path).to_path_buf()","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/utils/path-utils/src/lib.rs#L106-L142","documentation":"Error \"path {} has no parent directory\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/utils/path-utils/src/lib.rs:124 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":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}