Skip to content

Commit

Permalink
bpo-26228: [doc] Adapt PTY documentation updates from pythonGH-4167 (p…
Browse files Browse the repository at this point in the history
…ythonGH-27754)

Co-authored-by: Cornelius Diekmann <[email protected]>
  • Loading branch information
ambv and diekmann authored Aug 13, 2021
1 parent 230403a commit dd8eb30
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions Doc/library/pty.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
Expand All @@ -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:

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Lib/pty.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pty.spawn no longer hangs on FreeBSD, OS X, and Solaris.
pty.spawn no longer hangs on FreeBSD, macOS, and Solaris.

0 comments on commit dd8eb30

Please sign in to comment.