Skip to content
Snippets Groups Projects
Verified Commit db84e820 authored by Levente Polyak's avatar Levente Polyak :rocket: Committed by David Runge
Browse files

fix(util): support shells passing subshell fd as /dev/fd

This adds support orthogonal to shells that pass subshell fd as
/proc/self/fd.
parent 9f0db89a
No related branches found
No related tags found
1 merge request!88fix(util): support shells passing subshell fd as /dev/fd
......@@ -162,7 +162,8 @@ def transform_fd_to_tmpfile(working_dir: Path, sources: List[Path]) -> None:
sources: Paths that should be iterated and all fd's transformed to tmpfiles
"""
for index, source in enumerate(sources):
if str(source).startswith("/proc/self/fd"):
source_str = str(source)
if source_str.startswith("/proc/self/fd/") or source_str.startswith("/dev/fd/"):
file = mkstemp(dir=working_dir, prefix=f"{source.name}", suffix=".fd")[1]
with open(file, mode="wb") as f:
f.write(source.read_bytes())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment