Don't attempt to reopen named pipe (fifo)

This makes no sense and actually causes rec to hang on exit when there's no pipe reader.
This commit is contained in:
Marcin Kulik
2023-06-26 21:18:22 +02:00
parent a3c0779ca3
commit 6f54d2e3a8

View File

@@ -1,5 +1,3 @@
import os
import stat
from typing import IO, Any, Callable, Optional
@@ -29,15 +27,6 @@ class file_writer:
def _write(self, data: Any) -> None:
try:
self.file.write(data) # type: ignore
except BrokenPipeError as e:
if self.path != "-" and stat.S_ISFIFO(os.stat(self.path).st_mode):
self.on_error("Broken pipe, reopening...")
self._open_file()
self.on_error("Output pipe reopened successfully")
self.file.write(data) # type: ignore
else:
self.on_error("Output pipe broken, recording suspended")
raise e
except IOError as e:
self.on_error("Write error, recording suspended")
raise e