From 1c8e5f44802d69fdd5e7138c3ce43d8f2576ee5d Mon Sep 17 00:00:00 2001 From: Tomoki Imai Date: Sat, 23 Nov 2024 01:43:35 +0900 Subject: [PATCH] Use stdin.buffer in get_headers() We should use stdin.buffer.readline instead of stdin.readline because stdin.read* and stdin.buffer.read* should be used at the same time. (stdin.read* refers the internal buffer) --- python_files/python_server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_files/python_server.py b/python_files/python_server.py index ebcb67d22a5e..1689d9b8f7f9 100644 --- a/python_files/python_server.py +++ b/python_files/python_server.py @@ -163,7 +163,7 @@ def get_value(self) -> str: def get_headers(): headers = {} while True: - line = STDIN.readline().strip() + line = STDIN.buffer.readline().decode().strip() if not line: break name, value = line.split(":", 1)