Skip to content

Commit

Permalink
Use stdin.buffer in get_headers()
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
tomoki authored and karthiknadig committed Nov 26, 2024
1 parent b190169 commit 1c8e5f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python_files/python_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1c8e5f4

Please sign in to comment.