{"record":{"id":"47a5f5c76db8019e","repo":"biomejs/biome","slug":"to-be-a-utf-8-path","errorCode":null,"errorMessage":"To be a UTF-8 path","messagePattern":"To be a UTF-8 path","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/biome_fs/src/fs/os.rs","lineNumber":43,"sourceCode":"use super::{BoxedTraversal, File, FileSystemDiagnostic, FsErrorKind, PathKind};\n\n/// Implementation of [FileSystem] that directly calls through to the underlying OS\npub struct OsFileSystem {\n    pub working_directory: Option<Utf8PathBuf>,\n}\n\nimpl OsFileSystem {\n    pub fn new(working_directory: Utf8PathBuf) -> Self {\n        Self {\n            working_directory: Some(working_directory),\n        }\n    }\n}\n\nimpl Default for OsFileSystem {\n    fn default() -> Self {\n        let working_directory = env::current_dir()\n            .map(|p| Utf8PathBuf::from_path_buf(p).expect(\"To be a UTF-8 path\"))\n            .ok();\n        Self { working_directory }\n    }\n}\n\nimpl FileSystem for OsFileSystem {\n    fn open_with_options(\n        &self,\n        path: &Utf8Path,\n        options: OpenOptions,\n    ) -> io::Result<Box<dyn File>> {\n        let mut fs_options = fs::File::options();\n        Ok(Box::new(OsFile {\n            inner: options.into_fs_options(&mut fs_options).open(path)?,\n            version: 0,\n        }))\n    }\n","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/biomejs/biome/blob/405dedb0ff65dd29927faf587f6542e3c29db248/crates/biome_fs/src/fs/os.rs#L25-L61","documentation":"Error \"To be a UTF-8 path\" thrown in biomejs/biome.","triggerScenarios":"Thrown at crates/biome_fs/src/fs/os.rs:43 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use paths that are valid UTF-8; on Unix, avoid non-UTF-8 byte sequences in file names.","Convert the path to a UTF-8 representation before passing it to Biome."],"exampleFix":"let utf8 = path.to_str().ok_or_else(|| /* non-UTF-8 path error */)?;","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"405dedb0ff65dd29927faf587f6542e3c29db248","analyzedAt":"2026-08-20T00:25:09.682Z","contentChangedAt":"2026-08-20T00:25:09.682Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}