def fn1(stream: BinaryIO = sys.stdin.buffer):
for line in stream:
line = line.decode('utf-8').replace(' ', '') # <- error
x, y = line.strip().split('|') # <- error
print(x, y)
Incompatible types in assignment (expression has type "str", variable has type "bytes")
line = line.decode('utf-8')
line = line.replace(' ', '')