[New-bugs-announce] [issue45719] SubProcess stdin.flush freezes when running python interpreter

DJ PJs report at bugs.python.org
Thu Nov 4 20:42:46 EDT 2021


New submission from DJ PJs <djp1012878 at gmail.com>:

Keeping writing to a subprocess, and then flushing it to get the stdout works for other interpreters, but not python's.

Simplified Example of what I mean:

from subprocess import PIPE, Popen, CREATE_NEW_CONSOLE, run

subProcess = Popen("Python", stdin=PIPE, stdout=PIPE, text=True, universal_newlines=True)

subProcess.stdin.write('Print("HelloWorld")')

subProcess.stdin.flush()

for line in subProcess.stdout:
    print(">>> " + str(line.rstrip()))
    subProcess.stdout.flush()

----------
components: Library (Lib)
files: example.py
messages: 405761
nosy: djp1012878
priority: normal
severity: normal
status: open
title: SubProcess stdin.flush freezes when running python interpreter
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file50425/example.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45719>
_______________________________________


More information about the New-bugs-announce mailing list