Jeff Quast [Sat, 22 Nov 2014 08:13:01 +0000 (00:13 -0800)]
Fix test by prevent bash from sourcing profile
Instead, create a temporary file for use with
--rcfile argument with only the contents
``PS1='GO: '``, ensuring that the tests that
expect some form of '[$#]' succeeds even where
a user's default PS1 prompt does not contain it.
Jeff Quast [Sat, 22 Nov 2014 07:38:28 +0000 (23:38 -0800)]
Change 'ls -l /bin' test to 'uname -m -n ...'
This test intermittently fails on OSX, an example::
E -rwxr-xr-x 1 root wheel 106816 Sep 9 15:49 pax\r
E - -rwsr-xr-x 1 root wheel 46688 Sep 9 15:59 ps\r
E + -rwsr-xr-x 1 root wheel 46688 Sep 9 15:59 ps\r\r
E ? ++
E -rwxr-xr-x 1 root wheel 14208 Sep 9 15:44 pwd\r
Jeff Quast [Sat, 22 Nov 2014 07:18:45 +0000 (23:18 -0800)]
Ignore .git folder during test discovery.
On systems with slow hard disks, py.test can seemingly
hang for a noticeable while -- because it's crawling
the .git/ folder; instruct py.test to ignore it.
Rick Lin [Fri, 21 Nov 2014 01:29:41 +0000 (09:29 +0800)]
Remove confusing comment in daemonize() of example/cgishell.cgi
Jeff Quast [Thu, 20 Nov 2014 10:03:48 +0000 (02:03 -0800)]
Merge pull request #138 from rickhau/master
Rectify docstring typo in compile_pattern_list()
Rick Lin [Thu, 20 Nov 2014 08:32:36 +0000 (16:32 +0800)]
Rectify docstring typo in compile_pattern_list()
Thomas Kluyver [Thu, 23 Oct 2014 00:26:56 +0000 (17:26 -0700)]
Merge pull request #129 from zjx20/patch-1
Added ignore_sighup param for pxssh
zjx20 [Tue, 21 Oct 2014 01:16:16 +0000 (09:16 +0800)]
Added ignore_sighup param for pxssh
Thomas Kluyver [Mon, 13 Oct 2014 19:21:37 +0000 (12:21 -0700)]
Merge pull request #124 from h2suzuki/run-with-tuple-list-of-events
Modify run() to allow a tuple list of events.
Hideaki Suzuki [Sat, 11 Oct 2014 07:27:53 +0000 (16:27 +0900)]
Modify run() to allow a tuple list of events.
This is a feature enhancement mentioned by #116.
Thomas Kluyver [Tue, 30 Sep 2014 18:43:11 +0000 (11:43 -0700)]
Add Pexpect development team to copyright statement
Closes gh-117
Closes gh-118
Thomas Kluyver [Sun, 21 Sep 2014 19:34:34 +0000 (12:34 -0700)]
Make replwrap.bash() robust against custom prompts in bashrc
By providing our own bashrc which overrides PS1, we can have a
consistent prompt without breaking other customisations of bash that
people may want to keep, such as aliases defined in bashrc.
Thomas Kluyver [Sun, 21 Sep 2014 19:26:54 +0000 (12:26 -0700)]
Merge pull request #69 from takluyver/asyncio
asyncio integration for expect
Thomas Kluyver [Mon, 7 Jul 2014 03:45:35 +0000 (22:45 -0500)]
Stop testing on Python 2.6 and 3.2
We will drop support for these Python versions in Pexpect 4.0
Thomas Kluyver [Sat, 5 Jul 2014 19:37:02 +0000 (12:37 -0700)]
Document asyncio integration
Thomas Kluyver [Fri, 4 Jul 2014 00:26:42 +0000 (17:26 -0700)]
Expose async parameter for expect_exact
Thomas Kluyver [Fri, 4 Jul 2014 00:26:15 +0000 (17:26 -0700)]
Check already read data before async reading more
Thomas Kluyver [Thu, 3 Jul 2014 02:22:28 +0000 (19:22 -0700)]
Expand tests for async expect
Thomas Kluyver [Thu, 3 Jul 2014 02:22:08 +0000 (19:22 -0700)]
support timeout in async expect
Thomas Kluyver [Thu, 3 Jul 2014 02:21:07 +0000 (19:21 -0700)]
Fix EOF in async on Linux
Thomas Kluyver [Sat, 28 Jun 2014 01:10:05 +0000 (18:10 -0700)]
Expose async as parameter for expect
Thomas Kluyver [Sat, 28 Jun 2014 00:47:01 +0000 (17:47 -0700)]
Refactor expect code
Thomas Kluyver [Sat, 7 Jun 2014 01:00:20 +0000 (18:00 -0700)]
Initial stab at asyncio integration
Thomas Kluyver [Sun, 21 Sep 2014 17:51:00 +0000 (10:51 -0700)]
Merge pull request #114 from erikb85/master
enable echo deactivation in pxssh
Erik Bernoth [Sun, 21 Sep 2014 08:05:06 +0000 (10:05 +0200)]
enable echo deactivation in pxssh
I've learned from #112 that you can deactivate echoing of the input via
constructer parameter. This patch enables pxssh to do the same.
In spawn there is an alternative to the constructor parameter, which is
`set_echo(False)`. Sadly that doesn't work, at least in my experiments with
localhost.
Signed-off-by: Erik Bernoth <erik.bernoth@gmail.com>
Thomas Kluyver [Thu, 4 Sep 2014 17:44:51 +0000 (10:44 -0700)]
Merge pull request #109 from pexpect/issue-86-and-100-stdin-closed
Closes issue #86 and issue #100
jquast [Thu, 28 Aug 2014 06:28:05 +0000 (23:28 -0700)]
add to changelog
jquast [Thu, 28 Aug 2014 06:25:25 +0000 (23:25 -0700)]
add to changelog
Jeff Quast [Mon, 25 Aug 2014 07:21:27 +0000 (00:21 -0700)]
Merge pull request #99 from takluyver/issue-84
Unicode support for screen and ANSI
Jeff Quast [Mon, 25 Aug 2014 07:02:51 +0000 (07:02 +0000)]
Add tests for running as root on Solaris, using
'isroot' check.
jquast [Mon, 25 Aug 2014 06:46:10 +0000 (23:46 -0700)]
Closes issue #104 -- cannot execute sudo(8)
Previously, misinterpreted that os.access(file, X_OK)
always returns True on Solaris. Yes, but only for
the uid of 0. Python issue #13706 closed "not a bug"
reads to "just use os.stat()", so we went to great
lengths to do so quite exhaustively.
But this is wrong -- *only* when root, should we check
the file modes -- os.access of X_OK works perfectly
fine for non-root users.
And, we should only check if any of the executable bits
are set. Alas, it is true, you may execute that which
you may not read -- because as root, you can always read
it anyway.
Verified similar solution in NetBSD test.c (/bin/test),
OpenBSD ksh for its built-in test, and what FreeBSD/Darwin
for their implementation of which.c.
jquast [Sun, 24 Aug 2014 22:06:15 +0000 (15:06 -0700)]
Closes issue #86 and issue #100
Fallback to using stdout, and, when both stdin
and stdout are *both* closed, catch ValueError
and use the same constants as when the attached
process is not a terminal.
Thomas Kluyver [Fri, 8 Aug 2014 20:29:49 +0000 (13:29 -0700)]
Merge pull request #101 from BrianOn99/py3docstring
update documentation string in pexpect/__init__.py to be compatible with...
Chiu Yue Chun [Fri, 8 Aug 2014 07:54:20 +0000 (15:54 +0800)]
update documentation string in pexpect/__init__.py to be compatible with python 2 and 3
Thomas Kluyver [Tue, 5 Aug 2014 01:08:10 +0000 (18:08 -0700)]
Some changes based on reviewing the code
David O'Shea [Mon, 4 Aug 2014 05:08:34 +0000 (14:38 +0930)]
Address review comments regarding referring to "unicode strings" in docstrings.
David O'Shea [Mon, 4 Aug 2014 05:08:16 +0000 (14:38 +0930)]
Fix problems found in review.
David O'Shea [Sat, 2 Aug 2014 04:18:00 +0000 (13:48 +0930)]
Change SPACE to be a unicode string.
David O'Shea [Fri, 1 Aug 2014 07:40:58 +0000 (17:10 +0930)]
Don't define __bytes__(), and don't define __unicode__() on Python 3.
The previous attempt to add unicode support tried to make Python 2 and
3 behave in the same way apart from __str__(). This commit makes the
modules, and the tests, provide only __str__() on Python 3 and both
__str__() and __unicode__() on Python 2.
David O'Shea [Fri, 1 Aug 2014 07:40:40 +0000 (17:10 +0930)]
Disable Python 3.2 builds in Travis as changes only support 2.6, 2.7 and 3.3+.
David O'Shea [Fri, 1 Aug 2014 07:39:32 +0000 (17:09 +0930)]
Rename codec and codec_errors to encoding and encoding_errors respectively.
David O'Shea [Tue, 8 Jul 2014 01:10:27 +0000 (10:40 +0930)]
Issue #84: Unicode support in screen and ANSI.
This commit updates the the screen and ANSI modules to support Unicode
under Python 2.x. Under Python 3.x, it was already supported because
strings are Unicode by default. Now, on both Python versions:
- The constructors accept a codec name (defaults to 'latin-1') and a
scheme for handling encoding/decoding errors (defaults to
'replace'). The codec may be set to None to inhibit
encoding/decoding.
- Unicode is now used internally for storing the screen contents.
- Methods that accept input characters will, if passed input of type
'bytes' (or, under Python 2.x, 'str'), use the specified codec to
decode the input, otherwise treating it as Unicode.
- Methods that return screen contents now return Unicode, with the
exception of __str__() under Python 2.x, and __bytes__() in all
versions of Python, which return the screen contents encoded using
the specified codec.
These changes are designed to work only with Python 2.6, 2.7, and 3.3
and later, specifically versions that provide both b'' and u'' string
literals.
The check in ANSI for characters being printable is also removed, as
this prevents non-ASCII characters being accepted, which is not
compatible with the goal of adding Unicode support. This addresses
issue #83.
Thomas Kluyver [Tue, 22 Jul 2014 16:59:38 +0000 (09:59 -0700)]
Merge pull request #89 from dcoshea/issue-85-try2
Issue #85: Don't leave unwanted numbers in ANSI FSM stack/memory.
David O'Shea [Mon, 21 Jul 2014 23:28:34 +0000 (08:58 +0930)]
Address review comment (no parens around assert statement arguments).
jquast [Sun, 20 Jul 2014 06:36:21 +0000 (06:36 +0000)]
simplify at_max more like beyond_max
solaris and linux and bsd all have slightly 1-off differences
between their MAX_CANON; simply test that at least one BEL is
sent and not a whole lot more ..
jquast [Sat, 19 Jul 2014 00:29:18 +0000 (20:29 -0400)]
must test with echo=True for linux for BEL to ring
jquast [Sun, 20 Jul 2014 03:39:40 +0000 (20:39 -0700)]
Move entire class in 'if' block for py2.6 compat.
which does not provide decorator @unittest.skipIf.
Also remove maxread=, this is not necessary
jquast [Sun, 20 Jul 2014 03:34:20 +0000 (20:34 -0700)]
Two OSX fixes
- When echo=True, the full output is not received in this condition,
strangely enough, its a buffer of exactly 1024, any more than that,
no more bytes are received in the expect/select loop, even when
specifying very large values of searchwindowsize= and maxread=.
There is no reason for echo=True, we only rewrote the tests for
echo output to debug unexpected travis-CI behaviour, which we
could only find BEL on when echo was enabled, but this is not
true for debian linux.
- When using os.fpathconf on stdout under py.test in OSX, we get
OSError, stdin does not produce any such error, so use 0 instead
of 1.
jquast [Sun, 20 Jul 2014 01:59:59 +0000 (18:59 -0700)]
Merge branch 'doc-and-test-max-canon' of github.com:pexpect/pexpect into doc-and-test-max-canon
jquast [Sun, 20 Jul 2014 01:56:16 +0000 (18:56 -0700)]
Longer timeout for travis-CI for repl man 2 sleep
jquast [Fri, 18 Jul 2014 21:31:08 +0000 (17:31 -0400)]
BEL is rang only once for both Solaris and Linux
... lets check BSD
jquast [Sun, 20 Jul 2014 01:52:10 +0000 (01:52 +0000)]
SunOS has slightly different PC_MAX_CANON behavior
1. limit is actually PC_MAX_CANON + 1
2. BEL is not emitted *until* CR is sent
3. must use "stty erase ^H" for sendcontrol('h') to erase.
jquast [Fri, 18 Jul 2014 20:18:01 +0000 (16:18 -0400)]
Just skip tests on Travis-CI.
Last test python3.2 failed, all others passed.
This time, many python2.7 failed, all others passed.
There doesn't seem to be any consistant behaviour here, I give in.
jquast [Fri, 18 Jul 2014 20:01:34 +0000 (16:01 -0400)]
display .buffer, we need the full thing
having a difficult time finding why travis is not finding the full send_bytes of '_'
on *only* python3.3 unlike local debian/linux vm? -- however noticed the "man sleep"
also failed there due to TIMEOUT, so it could just be terribly slow, requiring more
than 5 second timeout -- we'll see ...
jquast [Fri, 18 Jul 2014 19:58:08 +0000 (15:58 -0400)]
man 2 sleep is failing again on travis due to low timeout
jquast [Fri, 18 Jul 2014 19:45:57 +0000 (15:45 -0400)]
attempt one remaining error for py3.2 on travis-ci
we know that sendline() wouldn't work once we've reached the buffer,
but on travis-ci, this means stdin sent *still* has not been flushed
or received by the child process -- for python3.2 only. So we go
ahead and send backspace and sendline *prior* to testing echo output
and bel. I'm not entirely sure we will see BEL where we expect, only
travis-ci can say for sure. It is passing on debian linux py3.2,
though.
jquast [Fri, 18 Jul 2014 19:31:41 +0000 (15:31 -0400)]
some more travis-ci accomidations
python3.2 and 3.4 on travis-ci are not flushing data to
child processes' stdin, presumably because CR is not yet
sent. tests are modified to always use sendline().
python3.2 on debian linux does not exhibit this same
behavior, so this is another hail mary. if we can't get
travis-ci to agree, we might just scrap these tests all
together, it only confirms and examplifies the behavior
documented in send().
jquast [Fri, 18 Jul 2014 18:59:54 +0000 (14:59 -0400)]
increase timeout by 2 seconds for travis-ci
hail mary.
jquast [Fri, 18 Jul 2014 18:57:27 +0000 (14:57 -0400)]
remove unicode literals u'' from tests
Travis python 3.2 is timing out, we might have to
increase the timeout, i hope... I'm testing on debian
linux ..
jquast [Fri, 18 Jul 2014 18:55:20 +0000 (14:55 -0400)]
document this issue as a "common issues".
I'm not sure entirely how common this is,
as somebody who runs into the issue, this might
be the first place I'd look ..
jquast [Fri, 18 Jul 2014 18:44:02 +0000 (14:44 -0400)]
Finish canonical mode processing docs and tests
Linux is certainly the rotten egg in this respect, I could find
the code for sending '\a' for canonical mode processing in the
various kernel drivers within just a few minutes -- with the exception
of linux. After several hours of investigation of the kernel tty
driver, I still can't find where exactly '\a', '0x07', or 'BEL'
is sent.
We just trust that it is, verified on debian Linux. We also discover
that PC_MAX_CANON is not used, but rather, a hardcoded value inside
the kernel driver of 4096; the length of a ring buffer data structure,
also tested by the distance of head <-> tail of such ring buffer.
Thomas Kluyver [Fri, 18 Jul 2014 01:31:11 +0000 (20:31 -0500)]
Merge pull request #93 from joedougherty/patch-1
Update commonissues.rst
Joe Dougherty [Thu, 17 Jul 2014 18:54:22 +0000 (14:54 -0400)]
Update commonissues.rst
Fixed minor typo in "Controlling SSH on Solaris" usage section.
David O'Shea [Tue, 8 Jul 2014 04:52:54 +0000 (14:22 +0930)]
Issue #85: Don't leave unwanted numbers in ANSI FSM stack/memory.
The FSM transitions set up by ANSI accept a number of escape sequences
that accept one or more numeric parameters where the escape sequence
as a whole is ignored (no action is executed at the end of the
sequence). This means that the numeric parameters are left on the
FSM's stack, making it harder to improve or subclass ANSI to handle
any of the sequences that take multiple numeric parameters, where it
is necessary to look at the entire stack rather than just, say, pop
one element off the top of the stack.
This fix sets up handlers that discard all items on the stack other
than the bottom-most, which is a reference to the ANSI instance
itself. The handlers are created as members of ANSI, rather than
methods in the ANSI package, so that they can be overridden in
subclasses without needing to replace FSM transitions.
A unit test is added to verify the new behavior, and the existing
test_number_x() unit test is modified to no longer expect the
parameters to be left on the stack after parsing, and instead use a
subclass of ANSI to capture them.
Thomas Kluyver [Mon, 7 Jul 2014 03:48:11 +0000 (22:48 -0500)]
Merge pull request #87 from dcoshea/issue-82
Issue #82: Handle more than two numbers in ANSI sequences
David O'Shea [Thu, 3 Jul 2014 10:21:26 +0000 (19:51 +0930)]
Issue #82: Handle more than two numbers in ANSI sequences
FSM transitions were not set up to accept more than one digit in the
third number, or to accept more than three numbers, in ANSI sequences
such as '\x1b[...m'. They were also not set up to capture the third
and subsequent numbers. This fix corrects these issues and adds a
unit test.
jquast [Sun, 29 Jun 2014 05:09:05 +0000 (22:09 -0700)]
Dealing with travis, force-set icanon
jquast [Sun, 29 Jun 2014 04:56:00 +0000 (21:56 -0700)]
Merge branch 'doc-and-test-max-canon' of github.com:pexpect/pexpect into doc-and-test-max-canon
jquast [Sun, 29 Jun 2014 04:55:20 +0000 (21:55 -0700)]
Merge branch 'doc-and-test-max-canon' of github.com:pexpect/pexpect into doc-and-test-max-canon
jquast [Sun, 29 Jun 2014 04:55:20 +0000 (21:55 -0700)]
Merge branch 'doc-and-test-max-canon' of github.com:pexpect/pexpect into doc-and-test-max-canon
jquast [Sun, 29 Jun 2014 04:13:24 +0000 (21:13 -0700)]
Test and document PC_MAX_CANON.
Closes issue #55.
I suspect since stdin is not a tty for travis,
that it is "failing", but try Trying maximum
of either/or PC_MAX_INPUT as well before I
go forcing icanon.
Jeff Quast [Sun, 29 Jun 2014 04:16:19 +0000 (21:16 -0700)]
Merge pull request #78 from pexpect/improve-upon-test-misc
Incremental housekeeping cleanup of test_misc.py
jquast [Sun, 29 Jun 2014 04:13:24 +0000 (21:13 -0700)]
Test and document PC_MAX_CANON.
Closes issue #55
jquast [Sat, 28 Jun 2014 18:58:54 +0000 (11:58 -0700)]
Incremental housekeeping cleanup of test_misc.py
- standard/local import grouping
- docstring every test
- pep8 formatting
- remove custom assertion messages
- Separate tests to individual groups
- Remove unnecessary time.sleep() calls
- use echo=False parameter, avoiding testing
combinations of mixed input+output, and removing
the need to document this strange combination.
- programmatically test searcher_re/_string
- prefer assertRaises/assertRaisesRegexp
- use tempfile.gettempdir() instead of /tmp
Jeff Quast [Sat, 28 Jun 2014 16:39:20 +0000 (09:39 -0700)]
Merge pull request #76 from takluyver/replwrap-bash-set-pager
Allow replwrap to reset pager so bash doesn't get stuck displaying things
Thomas Kluyver [Fri, 27 Jun 2014 00:40:57 +0000 (17:40 -0700)]
Allow replwrap to reset pager so bash doesn't get stuck displaying things
Thomas Kluyver [Thu, 26 Jun 2014 01:09:31 +0000 (18:09 -0700)]
Bump version number to 3.3
Thomas Kluyver [Thu, 26 Jun 2014 01:00:33 +0000 (18:00 -0700)]
Polish release notes
Thomas Kluyver [Tue, 24 Jun 2014 23:56:55 +0000 (16:56 -0700)]
Merge pull request #73 from pexpect/issue-44-solaris-try-3
Solaris support regarding setecho/setwinsize, new argument echo=False
jquast [Tue, 24 Jun 2014 23:43:25 +0000 (16:43 -0700)]
SRV4 -> SVR4
see https://en.wikipedia.org/wiki/SVR4#SVR4
jquast [Tue, 24 Jun 2014 22:08:34 +0000 (15:08 -0700)]
gah; fix constant VINTR -> INTR
Jeff Quast [Tue, 24 Jun 2014 21:51:39 +0000 (21:51 +0000)]
Merge branch 'issue-44-solaris-try-3' of github.com:pexpect/pexpect into issue-44-solaris-try-3
jquast [Tue, 24 Jun 2014 21:37:31 +0000 (14:37 -0700)]
Merge branch 'issue-44-solaris-try-3' of github.com:pexpect/pexpect into issue-44-solaris-try-3
Thomas Kluyver [Tue, 24 Jun 2014 21:35:03 +0000 (14:35 -0700)]
Fix up except syntax again
jquast [Tue, 24 Jun 2014 21:34:54 +0000 (14:34 -0700)]
note using py.test -- specify 'tests' folder
On Solaris and OSX, when running a bare 'py.test', it locks up
indefinitely after line, 'collecting 0 items'. ^C also does
not respond, so I'm not able to discern exactly where the
lockup is -- regardless, if you specify the 'tests' folder,
it issues fine.
Jeff Quast [Tue, 24 Jun 2014 21:27:07 +0000 (21:27 +0000)]
Use const child._VINTR instead of '3'
Jeff Quast [Tue, 24 Jun 2014 21:23:52 +0000 (21:23 +0000)]
Provide example of SRV4-like systems
Jeff Quast [Tue, 24 Jun 2014 20:44:47 +0000 (20:44 +0000)]
Refactor exceptions in __pty_make_controlling_tty
Make very clear which exceptions we expect, where, and why.
I've done exaustive testing from within cron(1) and without.
I've been unable to reproduce the previously discovered
os.ttyname issue, so that exception handling loop has been removed.
Also, resolves the ENXIO reference (thanks TK!). Pushing to
test this on OSX and later cygwin with the non_native pty fork test
Jeff Quast [Tue, 24 Jun 2014 19:38:25 +0000 (19:38 +0000)]
Merge branch 'issue-44-solaris-try-3' of github.com:pexpect/pexpect into issue-44-solaris-try-3
Conflicts:
doc/history.rst
pexpect/__init__.py
tests/test_expect.py
tests/test_interact.py
tests/test_misc.py
tests/test_unicode.py
Thomas Kluyver [Mon, 16 Jun 2014 02:30:59 +0000 (19:30 -0700)]
Miscellaneous minor fixes
Thomas Kluyver [Mon, 16 Jun 2014 02:26:42 +0000 (19:26 -0700)]
Implement assertRaises and assertRaisesRegexp context managers for Python 2.6
jquast [Sun, 8 Jun 2014 08:25:13 +0000 (01:25 -0700)]
Another "as err" vs ", err" exception fix.
as well as another indent-by-4 fix
jquast [Sun, 8 Jun 2014 08:19:24 +0000 (01:19 -0700)]
Missing time import -- there is no 'waitecho' function
although I am against most time.sleep()s and trying my best
to remove them where possible, there is no opposing
waitnoecho() function (perhaps we should supply one?).
Jeff Quast [Sun, 8 Jun 2014 08:07:03 +0000 (08:07 +0000)]
Solaris support, tested on SmartOS from cron(1).
Thomas Kluyver [Mon, 16 Jun 2014 01:39:52 +0000 (18:39 -0700)]
Merge pull request #72 from pexpect/interact-does-not-detect-eof
Interact() does not detect EOF
Thomas Kluyver [Mon, 16 Jun 2014 01:06:58 +0000 (18:06 -0700)]
Make a modified copy of os.environ for interact tests
jquast [Sun, 8 Jun 2014 04:45:22 +0000 (21:45 -0700)]
For python3, exceptions should use "as err", not ", err"
jquast [Sun, 8 Jun 2014 04:37:36 +0000 (21:37 -0700)]
python3.2 accommodations
jquast [Sun, 8 Jun 2014 04:35:16 +0000 (21:35 -0700)]
Document and detect EOF condition in interact()
jquast [Sun, 8 Jun 2014 04:25:20 +0000 (21:25 -0700)]
Improve EOF through test -> interact -> echo_prompt