summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorƁukasz Langa <lukasz@langa.pl>2021-08-13 10:57:07 (GMT)
committerGitHub <noreply@github.com>2021-08-13 10:57:07 (GMT)
commitdd8eb303b90d63e1f56684bedadca6674bb74a29 (patch)
treeae2f05d8cabf3850ac48815a82f79abaac883677
parent230403a6a19042b174374c3825904d2e857f38b0 (diff)
downloadcpython-dd8eb303b90d63e1f56684bedadca6674bb74a29.zip
cpython-dd8eb303b90d63e1f56684bedadca6674bb74a29.tar.gz
cpython-dd8eb303b90d63e1f56684bedadca6674bb74a29.tar.bz2
bpo-26228: [doc] Adapt PTY documentation updates from GH-4167 (GH-27754)
Co-authored-by: Cornelius Diekmann <c.diekmann@googlemail.com>
-rw-r--r--Doc/library/pty.rst14
-rw-r--r--Lib/pty.py2
-rw-r--r--Misc/NEWS.d/next/Library/2019-02-26-09-31-59.bpo-26228.wyrHKc.rst2
3 files changed, 11 insertions, 7 deletions
diff --git a/Doc/library/pty.rst b/Doc/library/pty.rst
index 4b49d24..7f4da41 100644
--- a/Doc/library/pty.rst
+++ b/Doc/library/pty.rst
@@ -2,8 +2,8 @@
========================================
.. module:: pty
- :platform: Linux
- :synopsis: Pseudo-Terminal Handling for Linux.
+ :platform: Unix
+ :synopsis: Pseudo-Terminal Handling for Unix.
.. moduleauthor:: Steen Lumholt
.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
@@ -16,9 +16,9 @@ The :mod:`pty` module defines operations for handling the pseudo-terminal
concept: starting another process and being able to write to and read from its
controlling terminal programmatically.
-Because pseudo-terminal handling is highly platform dependent, there is code to
-do it only for Linux. (The Linux code is supposed to work on other platforms,
-but hasn't been tested yet.)
+Pseudo-terminal handling is highly platform dependent. This code is mainly
+tested on Linux, FreeBSD, and macOS (it is supposed to work on other POSIX
+platforms but it's not been thoroughly tested).
The :mod:`pty` module defines the following functions:
@@ -47,6 +47,10 @@ The :mod:`pty` module defines the following functions:
spawned behind the pty will eventually terminate, and when it does *spawn*
will return.
+ A loop copies STDIN of the current process to the child and data received
+ from the child to STDOUT of the current process. It is not signaled to the
+ child if STDIN of the current process closes down.
+
The functions *master_read* and *stdin_read* are passed a file descriptor
which they should read from, and they should always return a byte string. In
order to force spawn to return before the child process exits an
diff --git a/Lib/pty.py b/Lib/pty.py
index 43e974f..8d8ce40 100644
--- a/Lib/pty.py
+++ b/Lib/pty.py
@@ -1,7 +1,7 @@
"""Pseudo terminal utilities."""
# Bugs: No signal handling. Doesn't set slave termios and window size.
-# Only tested on Linux.
+# Only tested on Linux, FreeBSD, and macOS.
# See: W. Richard Stevens. 1992. Advanced Programming in the
# UNIX Environment. Chapter 19.
# Author: Steen Lumholt -- with additions by Guido.
diff --git a/Misc/NEWS.d/next/Library/2019-02-26-09-31-59.bpo-26228.wyrHKc.rst b/Misc/NEWS.d/next/Library/2019-02-26-09-31-59.bpo-26228.wyrHKc.rst
index 43ff580..c6ca84a 100644
--- a/Misc/NEWS.d/next/Library/2019-02-26-09-31-59.bpo-26228.wyrHKc.rst
+++ b/Misc/NEWS.d/next/Library/2019-02-26-09-31-59.bpo-26228.wyrHKc.rst
@@ -1 +1 @@
-pty.spawn no longer hangs on FreeBSD, OS X, and Solaris. \ No newline at end of file
+pty.spawn no longer hangs on FreeBSD, macOS, and Solaris.