fix(server): route writelines through the pipe-safe write

writelines() was forwarded straight to the wrapped stream by __getattr__,
so it could still raise BrokenPipeError after the app's pipe closed.
This commit is contained in:
jamiepine
2026-10-03 23:59:43 +00:00
committed by capy-ai-staging[bot]
parent 848bb2e4c6
commit c9f5f2c3e7
+4
View File
@@ -47,6 +47,10 @@ class _PipeSafeStream:
self._stream = open(os.devnull, 'w')
return len(s)
def writelines(self, lines):
for line in lines:
self.write(line)
def flush(self):
try:
self._stream.flush()