Skip to content

Commit 2b7913a

Browse files
committed
Fix unguarded Pipfile read in pipenv_venv_in_project
Replace bare std::fs::read_to_string with read_regular_to_string_sync to prevent hanging when Pipfile is a FIFO or device. This aligns with the existing FIFO-safe reads used elsewhere in the python_crawler module.
1 parent ee69855 commit 2b7913a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎crates/socket-patch-core/src/crawlers/python_crawler.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ fn pipenv_venv_in_project(cwd: &Path, var: &impl Fn(&str) -> Option<String>) ->
380380
Some(Err(text)) if !text.is_empty() => return Some(true),
381381
_ => {}
382382
}
383-
let text = std::fs::read_to_string(cwd.join("Pipfile")).ok()?;
383+
let text = read_regular_to_string_sync(&cwd.join("Pipfile")).ok()?;
384384
let doc = text.parse::<toml_edit::DocumentMut>().ok()?;
385385
let value = doc.get("pipenv")?.get("venv_in_project")?.as_value()?;
386386
// Python's `bool(value)` for the scalar shapes a Pipfile can hold.

0 commit comments

Comments
 (0)