NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #234 most downloaded on PyPI
Pexpect allows easy control of interactive console applications.
Last release 3 years ago
no release in 18 months
Ships unpredictably
gaps range from 5 weeks to 3.8 years
Some releases are documented
notes for 9 of 20 stable releases
Nothing withdrawn
no release was ever pulled
18 years old
20 releases · first in 2008
Nothing published for this version
Returned behavior of searchwindowsize to that in 4.3 and earlier (searches are only done within the search window) ( #579 ).
before attribute after a timeout (#579).searchwindowsize if it was increased between calls (#579).str_last_chars rather than always 100 (#598).One column per quarter.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Version number -> 4.3.1
Version number -> 4.3.1
When launching bash for pexpect.replwrap, load the system bashrc from a couple of different common locations (457), and then unset the PROMPT_COMMAND environment variable, which can interfere with the prompt we're expecting (459).
The async= parameter to integrate with asyncio has become async_= (431), as async is becoming a Python keyword from Python 3.6. Pexpect will still recognise async as an alternative spelling.
Similarly, the module pexpect.async became pexpect._async (450). This module is not part of the public API.
Fix problems with asyncio objects closing file descriptors during garbage collection (347, 376).
Set the .pid attribute of a ~.PopenSpawn object (417).
Fix passing Windows paths to ~.PopenSpawn (446).
~.PopenSpawn on Windows can pass string commands through to Popen without splitting them into a list (447).
Stop shlex trying to read from stdin when ~.PopenSpawn is passed cmd=None (433, 434).
Ensure that an error closing a Pexpect spawn object raises a Pexpect error, rather than a Ptyprocess error (383, 386).
Cleaned up invalid backslash escape sequences in strings (430, 445).
The pattern for a password prompt in pexpect.pxssh changed from password to password: (452).
Correct docstring for using unicode with spawn (395).
Various other improvements to documentation.
Nothing published for this version
Fix to allow running env in replwrap-ed bash.
Fix to allow running env in replwrap-ed bash.
Raise more informative exception from pxssh if it fails to connect.
Change passmass example to not log passwords entered.
Fix to allow running env in replwrap-ed bash.
Raise more informative exception from pxssh if it fails to connect.
Change passmass example to not log passwords entered.
Change: When an env parameter is specified to the ~.spawn or ~.run family of calls containing a value for PATH, its value is used to discover the target executable from a relative path, rather than the current process's environment PATH. This mirrors the behavior of subprocess.Popen in the standard library (348).
Regression: Re-introduce capability for read_nonblocking in class fdspawn as previously supported in version 3.3 (359).
Nothing published for this version
Nothing published for this version
Nothing published for this version
Deprecated pexpect.screen and pexpect.ANSI . Please use other packages such as pyte to emulate a terminal.
Integration with asyncio : passing async=True to expect() , expect_exact() or expect_list() will make them return a coroutine. You can get the result using yield from , or wrap it in an asyncio.Task . This allows the event loop to do other things while waiting for output that matches a pattern.
Experimental support for Windows (with some caveats)—see Pexpect on Windows .
Enhancement: allow method as callbacks of argument events for pexpect.run() ( #176 ).
It is now possible to call wait() multiple times, or after a process is already determined to be terminated without raising an exception ( PR #211 ).
New pexpect.spawn keyword argument, dimensions=(rows, columns) allows setting terminal screen dimensions before launching a program ( #122 ).
Fix regression that prevented executable, but unreadable files from being found when not specified by absolute path – such as /usr/bin/sudo ( #104 ).
Fixed regression when executing pexpect with some prior releases of the multiprocessing module where stdin has been closed ( #86 ).
Deprecated pexpect.screen and pexpect.ANSI . Please use other packages such as 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 pexpect.spawn defaults to False. To get the old behaviour, pass ignore_sighup=True .
Integration with asyncio: passing async=True to ~.spawn.expect, ~.spawn.expect_exact or ~.spawn.expect_list will make them return a coroutine. You can get the result using yield from, or wrap it in an asyncio.Task. This allows the event loop to do other things while waiting for output that matches a pattern.
Experimental support for Windows (with some caveats)—see windows.
Enhancement: allow method as callbacks of argument events for pexpect.run (176).
It is now possible to call ~.spawn.wait multiple times, or after a process is already determined to be terminated without raising an exception (211).
New pexpect.spawn keyword argument, dimensions=(rows, columns) allows setting terminal screen dimensions before launching a program (122).
Fix regression that prevented executable, but unreadable files from being found when not specified by absolute path -- such as /usr/bin/sudo (104).
Fixed regression when executing pexpect with some prior releases of the multiprocessing module where stdin has been closed (86).
Deprecated pexpect.screen and pexpect.ANSI. Please use other packages such as 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 pexpect.spawn defaults to False. To get the old behaviour, pass ignore_sighup=True.
Added a mechanism to wrap REPLs, or shells, in an object which can conveniently be used to send commands and wait for the output (pexpect.replwrap).
Fixed issue where pexpect would attempt to execute a directory because it has the 'execute' bit set (37).
Removed the pexpect.psh module. This was never documented, and we found no evidence that people use it. The new pexpect.replwrap module provides a more flexible alternative.
Fixed TypeError: got <type 'str'> ('\r\n') as pattern in spawnu.readline method (67).
Fixed issue where EOF was not correctly detected in ~.interact, causing a repeating loop of output on Linux, and blocking before EOF on BSD and Solaris (49).
Several Solaris (SmartOS) bugfixes, preventing IOError exceptions, especially when used with cron(1) (44).
Added new keyword argument echo=True for spawn. On SVR4-like systems, the method ~.isatty will always return False: the child pty does not appear as a terminal. Therefore, ~.setecho, ~.getwinsize, ~.setwinsize, and ~.waitnoecho are not supported on those platforms.
After this, we intend to start working on a bigger refactoring of the code, to be released as Pexpect 4. There may be more bugfix 3.x releases, however.
Added a mechanism to wrap REPLs, or shells, in an object which can conveniently be used to send commands and wait for the output ( pexpect.replwrap ).
Added a mechanism to wrap REPLs, or shells, in an object which can conveniently be used to send commands and wait for the output ( pexpect.replwrap ).
Fixed issue where pexpect would attempt to execute a directory because it has the ‘execute’ bit set ( #37 ).
Removed the pexpect.psh module. This was never documented, and we found no evidence that people use it. The new pexpect.replwrap module provides a more flexible alternative.
Fixed TypeError: got <type 'str'> ('\r\n') as pattern in spawnu.readline() method ( #67 ).
Fixed issue where EOF was not correctly detected in interact() , causing a repeating loop of output on Linux, and blocking before EOF on BSD and Solaris ( #49 ).
Several Solaris (SmartOS) bugfixes, preventing IOError exceptions, especially when used with cron(1) ( #44 ).
Added new keyword argument echo=True for spawn . On SVR4-like systems, the method isatty() will always return False : the child pty does not appear as a terminal. Therefore, setecho() , getwinsize() , setwinsize() , and waitnoecho() are not supported on those platforms.
After this, we intend to start working on a bigger refactoring of the code, to be released as Pexpect 4. There may be more bugfix 3.x releases, however.
Fix exception handling from select.select() on Python 2 ( PR #38 ). This was accidentally broken in the previous release when it was fixed for Python
Fix exception handling from select.select() on Python 2 ( PR #38 ). This was accidentally broken in the previous release when it was fixed for Python 3.
Removed a workaround for TIOCSWINSZ on very old systems, which was causing issues on some BSD systems ( PR #40 ).
Fixed an issue with exception handling in pxssh ( PR #43 )
The documentation for pxssh was improved.
Fix exception handling from select.select on Python 2 (38). This was accidentally broken in the previous release when it was fixed for Python 3.
Removed a workaround for TIOCSWINSZ on very old systems, which was causing issues on some BSD systems (40).
Fixed an issue with exception handling in ~pexpect.pxssh (43)
The documentation for ~pexpect.pxssh was improved.
Fix an issue that prevented importing pexpect on Python 3 when sys.stdout was reassigned (30).
Improve prompt synchronisation in ~pexpect.pxssh (28).
Fix pickling exception instances (34).
Fix handling exceptions from select.select on Python 3 (33).
The examples have also been cleaned up somewhat - this will continue in future releases.
Fix an issue that prevented importing pexpect on Python 3 when sys.stdout was reassigned ( #30 ).
Fix an issue that prevented importing pexpect on Python 3 when sys.stdout was reassigned ( #30 ).
Improve prompt synchronisation in pxssh ( PR #28 ).
Fix pickling exception instances ( PR #34 ).
Fix handling exceptions from select.select() on Python 3 ( PR #33 ).
The examples have also been cleaned up somewhat - this will continue in future releases.
The new major version number doesn’t indicate any deliberate API incompatibility. We have endeavoured to avoid breaking existing APIs. However, pexpec
The new major version number doesn’t indicate any deliberate API incompatibility. We have endeavoured to avoid breaking existing APIs. However, pexpect is under new maintenance after a long dormancy, so some caution is warranted.
A new unicode API was introduced.
Python 3 is now supported, using a single codebase.
Pexpect now requires at least Python 2.6 or 3.2.
The modules other than pexpect, such as pexpect.fdpexpect and pexpect.pxssh , were moved into the pexpect package. For now, wrapper modules are installed to the old locations for backwards compatibility (e.g. import pxssh will still work), but these will be removed at some point in the future.
Ignoring SIGHUP is now optional - thanks to Kimmo Parviainen-Jalanko for the patch.
We also now have docs on ReadTheDocs , and continuous integration on Travis CI .
The new major version number doesn't indicate any deliberate API incompatibility. We have endeavoured to avoid breaking existing APIs. However, pexpect is under new maintenance after a long dormancy, so some caution is warranted.
A new unicode API was introduced.
Python 3 is now supported, using a single codebase.
Pexpect now requires at least Python 2.6 or 3.2.
The modules other than pexpect, such as pexpect.fdpexpect and pexpect.pxssh, were moved into the pexpect package. For now, wrapper modules are installed to the old locations for backwards compatibility (e.g. import pxssh will still work), but these will be removed at some point in the future.
Ignoring SIGHUP is now optional - thanks to Kimmo Parviainen-Jalanko for the patch.
We also now have docs on ReadTheDocs, and continuous integration on Travis CI.
Fix a bug regarding making the pty the controlling terminal when the process spawning it is not, actually, a terminal (such as from cron)
Fix a bug regarding making the pty the controlling terminal when the process spawning it is not, actually, a terminal (such as from cron)
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →