Hirokazu Yamamoto added the comment:
Interestingly, following code also hangs. Maybe I'm
misunderstanding the meaning of *bufsize*
from subprocess import *
import sys
p = Popen([sys.executable, "-c", "import sys; print(sys.stdin.read(1))"],
stdin=PIPE)
p.stdin.write(b'xx') # size 2
p.wait
New submission from Hirokazu Yamamoto :
Following script hangs on Python3.x.
from subprocess import *
import sys
p = Popen([sys.executable, "-c", "import sys; print(sys.stdin.read(1))"],
stdin=PIPE)
p.stdin.write(b'x')
p.wait()
This is because unbuffered functionality of
subprocess.Popen is d