Skip to content

Commit b22a0ef

Browse files
committed
fix: handle non-UTF-8 binary output on Windows
Use errors="replace" when decoding stdout/stderr from recorder binary to handle Windows console encoding (CP1252) gracefully.
1 parent 2c6adf7 commit b22a0ef

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

videodb/capture.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ async def _read_stdout_loop(self):
238238
if not line:
239239
break
240240

241-
line_str = line.decode("utf-8").strip()
241+
line_str = line.decode("utf-8", errors="replace").strip()
242242
if not line_str.startswith("videodb_recorder|"):
243243
continue
244244

@@ -268,7 +268,7 @@ async def _read_stderr_loop(self):
268268
line = await self._proc.stderr.readline()
269269
if not line:
270270
break
271-
logger.debug(f"[Recorder Binary]: {line.decode('utf-8').strip()}")
271+
logger.debug(f"[Recorder Binary]: {line.decode('utf-8', errors='replace').strip()}")
272272

273273
async def shutdown(self):
274274
"""Cleanly terminate the recorder binary process."""

0 commit comments

Comments
 (0)