Martin Panter added the comment:
This is a change in behaviour of the _copy() loop: it will stop as soon as EOF
is read from the parent’s input, and immediately close the terminal master.
Unpatched, the loop continues to read output from the child, until the child
closes the terminal slave.
I agree that your new behaviour may be desired in some cases, but you need to
respect backwards compatibility. With your patch, things will no longer work
robustly when the child “has the last word”, i.e. it writes output and exits
without reading any (extra) input. Simple example: the child prints a message,
but the parent has no input:
python -c 'import pty; pty.spawn("./message.py")' < /dev/null
Any new functionality would also need documenting. (If you want to suggest some
wording to document the existing behaviour better, that would also be welcome :)
----------
versions: -Python 3.4, Python 3.5, Python 3.6
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue29054>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com