summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Kluyver <takowl@gmail.com>2015-09-22 22:45:21 +0100
committerThomas Kluyver <takowl@gmail.com>2015-09-22 22:45:21 +0100
commit55d7aad50d9808be6eed989b5676b19b1a09ffe7 (patch)
tree7c928ee4ad19c6c9610849f5f3b4bde7b5e8d4c4
parentea586fb9a545854f9b1212779653ec80f3428a2c (diff)
parent3c1bc018218b86177e1cdf8e93ead035afacc421 (diff)
downloadpexpect-55d7aad50d9808be6eed989b5676b19b1a09ffe7.tar.gz
Merge pull request #267 from pexpect/default-handle-sighup-pull
Change ignore_sighup default to False
-rw-r--r--doc/history.rst17
-rw-r--r--pexpect/pty_spawn.py7
2 files changed, 15 insertions, 9 deletions
diff --git a/doc/history.rst b/doc/history.rst
index d60402a..b33e4d9 100644
--- a/doc/history.rst
+++ b/doc/history.rst
@@ -17,11 +17,6 @@ Version 4.0
* It is now possible to call :meth:`~.wait` multiple times, or after a process
is already determined to be terminated without raising an exception
(:ghpull:`211`).
-* Deprecated ``pexpect.screen`` and ``pexpect.ANSI``. Please use other packages
- such as `pyte <https://pypi.python.org/pypi/pyte>`__ to emulate a terminal.
-* Removed the independent top-level modules (``pxssh fdpexpect FSM screen ANSI``)
- which were installed alongside Pexpect. These were moved into the Pexpect
- package in 3.0, but the old names were left as aliases.
* New :class:`pexpect.spawn` keyword argument, ``dimensions=(rows, columns)``
allows setting terminal screen dimensions before launching a program
(:ghissue:`122`).
@@ -31,6 +26,18 @@ Version 4.0
* Fixed regression when executing pexpect with some prior releases of
the multiprocessing module where stdin has been closed (:ghissue:`86`).
+Backwards incompatible changes
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+* Deprecated ``pexpect.screen`` and ``pexpect.ANSI``. Please use other packages
+ such as `pyte <https://pypi.python.org/pypi/pyte>`__ to emulate a terminal.
+* Removed the independent top-level modules (``pxssh fdpexpect FSM screen ANSI``)
+ which were installed alongside Pexpect. These were moved into the Pexpect
+ package in 3.0, but the old names were left as aliases.
+* Child processes created by Pexpect no longer ignore SIGHUP by default: the
+ ``ignore_sighup`` parameter of :class:`pexpect.spawn` defaults to False. To
+ get the old behaviour, pass ``ignore_sighup=True``.
+
Version 3.3
```````````
diff --git a/pexpect/pty_spawn.py b/pexpect/pty_spawn.py
index 9141b17..7280a01 100644
--- a/pexpect/pty_spawn.py
+++ b/pexpect/pty_spawn.py
@@ -36,7 +36,7 @@ class spawn(SpawnBase):
def __init__(self, command, args=[], timeout=30, maxread=2000,
searchwindowsize=None, logfile=None, cwd=None, env=None,
- ignore_sighup=True, echo=True, preexec_fn=None,
+ ignore_sighup=False, echo=True, preexec_fn=None,
encoding=None, codec_errors='strict', dimensions=None):
'''This is the constructor. The command parameter may be a string that
includes a command and any arguments to the command. For example::
@@ -129,9 +129,8 @@ class spawn(SpawnBase):
child.logfile_send = fout
If ``ignore_sighup`` is True, the child process will ignore SIGHUP
- signals. For now, the default is True, to preserve the behaviour of
- earlier versions of Pexpect, but you should pass this explicitly if you
- want to rely on it.
+ signals. The default is False from Pexpect 4.0, meaning that SIGHUP
+ will be handled normally by the child.
The delaybeforesend helps overcome a weird behavior that many users
were experiencing. The typical problem was that a user would expect() a