openai/codex · error · io::Error
path `{}` is not a file
Error message
path `{}` is not a file What it means
Error "path `{}` is not a file" thrown in openai/codex.
Source
Thrown at codex-rs/exec-server/src/regular_file.rs:12
use std::io;
use std::path::Path;
use tokio::io::AsyncReadExt;
pub(crate) async fn open(path: &Path) -> io::Result<tokio::fs::File> {
let mut options = tokio::fs::OpenOptions::new();
options.read(true);
configure_open(&mut options);
let file = options.open(path).await?;
if !is_disk_file(&file) || !file.metadata().await?.is_file() {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
format!("path `{}` is not a file", path.display()),
));
}
Ok(file)
}
/// Reads a regular UTF-8 file without following a symlink at its final path component.
pub async fn read_sensitive_file_to_string(path: &Path) -> io::Result<String> {
let mut options = tokio::fs::OpenOptions::new();
options.read(true);
configure_open(&mut options);
#[cfg(unix)]
options.custom_flags(libc::O_NONBLOCK | libc::O_NOFOLLOW);
#[cfg(windows)]
{View on GitHub (pinned to 339751715c)
When it happens
Trigger: Thrown at codex-rs/exec-server/src/regular_file.rs:12 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/ccf608db66a27bca.
Report an issue: GitHub.