I got the following error: TypeError: input() got an unexpected keyword argument 'encoding' when trying to read from stdin in python using fileinput.input(), but the documentation says file input should be used like that.
I'm using python 3.9
import fileinput
for line in fileinput.input(encoding="utf-8"):
process(line)