mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 11:48:13 +01:00
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:
@@ -1,5 +1,3 @@
|
|||||||
import os
|
|
||||||
import stat
|
|
||||||
from typing import IO, Any, Callable, Optional
|
from typing import IO, Any, Callable, Optional
|
||||||
|
|
||||||
|
|
||||||
@@ -29,15 +27,6 @@ class file_writer:
|
|||||||
def _write(self, data: Any) -> None:
|
def _write(self, data: Any) -> None:
|
||||||
try:
|
try:
|
||||||
self.file.write(data) # type: ignore
|
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:
|
except IOError as e:
|
||||||
self.on_error("Write error, recording suspended")
|
self.on_error("Write error, recording suspended")
|
||||||
raise e
|
raise e
|
||||||
|
|||||||
Reference in New Issue
Block a user