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 committed Nov 22, 2024
1 parent ae0ea9c commit cd9a0cc
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 cd9a0cc

Please sign in to comment.