Skip to content

Commit

Permalink
remove buffering development artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
asmacdo committed May 14, 2024
1 parent 22c0def commit d8bd80a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/duct.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def __init__(self, file_path, buffer):
def start(self):
Path(self.file_path).touch()
self.stop_event = threading.Event()
self.infile = open(self.file_path, "rb", buffering=0)
self.infile = open(self.file_path, "rb")
self.thread = threading.Thread(target=self._tail, daemon=True)
self.thread.start()

Expand Down Expand Up @@ -335,7 +335,7 @@ def main():
args.capture_outputs, args.outputs, formatted_output_prefix
)
if isinstance(stdout, TailPipe):
stdout_file = open(stdout.file_path, "wb", buffering=0)
stdout_file = open(stdout.file_path, "wb")
else:
stdout_file = stdout
if isinstance(stderr, TailPipe):
Expand All @@ -347,7 +347,6 @@ def main():
[str(args.command)] + args.arguments,
stdout=stdout_file,
stderr=stderr_file,
bufsize=0,
preexec_fn=os.setsid,
)
session_id = os.getsid(process.pid) # Get session ID of the new process
Expand Down Expand Up @@ -386,5 +385,4 @@ def main():


if __name__ == "__main__":
os.environ["PYTHONUNBUFFERED"] = "1"
main()

0 comments on commit d8bd80a

Please sign in to comment.