From 73fd29a13a83b077f3828d88daabdff23a8e74a8 2023-01-12 00:31:59 From: Garland Zhang Date: 2023-01-12 00:31:59 Subject: [PATCH] Update script.py Handle non utf-8 characters during decoding for %%bash --- diff --git a/IPython/core/magics/script.py b/IPython/core/magics/script.py index 9fd2fc6..e0615c0 100644 --- a/IPython/core/magics/script.py +++ b/IPython/core/magics/script.py @@ -210,7 +210,7 @@ class ScriptMagics(Magics): async def _handle_stream(stream, stream_arg, file_object): while True: - line = (await stream.readline()).decode("utf8") + line = (await stream.readline()).decode("utf8", errors="replace") if not line: break if stream_arg: