{"record":{"id":"c7a808516fe1a677","repo":"sxyazi/yazi","slug":"trash-info-has-no-path","errorCode":null,"errorMessage":"trash info has no Path","messagePattern":"trash info has no Path","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"yazi-fs/src/trash/freedesktop/trash_info.rs","lineNumber":53,"sourceCode":"\t\t\treturn Err(io::Error::new(io::ErrorKind::InvalidData, \"invalid original trash path\"));\n\t\t}\n\n\t\tOk(Self { root: root.to_owned(), backing: root.join(\"files\").join(stem), original })\n\t}\n\n\tfn parse_original(info: &Path, root: &Path) -> io::Result<PathBuf> {\n\t\tlet mut reader = BufReader::new(File::open(info)?);\n\t\tlet mut line = Vec::new();\n\n\t\treader.read_until(b'\\n', &mut line)?;\n\t\tSelf::trim_line(&mut line);\n\t\tif line != b\"[Trash Info]\" {\n\t\t\treturn Err(io::Error::new(io::ErrorKind::InvalidData, \"invalid trash info header\"));\n\t\t}\n\n\t\tloop {\n\t\t\tline.clear();\n\t\t\tif reader.read_until(b'\\n', &mut line)? == 0 {\n\t\t\t\treturn Err(io::Error::new(io::ErrorKind::InvalidData, \"trash info has no Path\"));\n\t\t\t}\n\n\t\t\tSelf::trim_line(&mut line);\n\t\t\tlet Some(value) = line.strip_prefix(b\"Path=\") else { continue };\n\t\t\tlet decoded: Cow<[u8]> = percent_decode(value).into();\n\n\t\t\tlet path = Path::new(OsStr::from_bytes(decoded.as_ref()));\n\t\t\tif path.as_os_str().is_empty() || !path.is_absolute() && path.has_parent_component() {\n\t\t\t\treturn Err(io::Error::new(io::ErrorKind::InvalidData, \"invalid original trash path\"));\n\t\t\t}\n\n\t\t\treturn Ok(if path.is_absolute() {\n\t\t\t\tpath.to_owned()\n\t\t\t} else {\n\t\t\t\tSelf::mount_point(root)?.join(path)\n\t\t\t});\n\t\t}","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/sxyazi/yazi/blob/a541adde4e5b082719a0f21a87eb3eab071ece58/yazi-fs/src/trash/freedesktop/trash_info.rs#L35-L71","documentation":"Error \"trash info has no Path\" thrown in sxyazi/yazi.","triggerScenarios":"Thrown at yazi-fs/src/trash/freedesktop/trash_info.rs:55 when the library encounters an invalid state.","commonSituations":"Parsing a .trashinfo file that has no `Path=` line.","solutions":["The .trashinfo file has no Path= line; restore the item manually or delete the corrupt info file."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a541adde4e5b082719a0f21a87eb3eab071ece58","analyzedAt":"2026-08-19T05:27:26.468Z","contentChangedAt":"2026-08-19T05:27:26.468Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}