Open
Description
import subprocess
process = subprocess.Popen("echo hello", shell=True, stdout=subprocess.PIPE)
assert process.stdout is not None
print(process.stdout.read1())
mypy error:
asd.py:4: error: "IO[bytes]" has no attribute "read1"; maybe "read"?
Found 1 error in 1 file (checked 1 source file)
But at runtime there is read1()
method. It is useful because unlike read()
, it will return the output as soon as it is available, instead of reading more until it gets n bytes or end of file.