third_party/pexpect
9 years agoSimple fix for ftp.openbsd.org example
Jeff Quast [Sun, 23 Nov 2014 12:31:14 +0000 (04:31 -0800)]
Simple fix for ftp.openbsd.org example

9 years agoMerge pull request #139 from rickhau/master
Jeff Quast [Sun, 23 Nov 2014 05:16:48 +0000 (21:16 -0800)]
Merge pull request #139 from rickhau/master

Remove confusing comment in daemonize() of example/cgishell.cgi

9 years agoMerge pull request #142 from pexpect/failed-str-self
Jeff Quast [Sun, 23 Nov 2014 05:16:13 +0000 (21:16 -0800)]
Merge pull request #142 from pexpect/failed-str-self

Failure in __str__() before any output.

9 years agoUse str(p) and not p.__str__()
Jeff Quast [Sun, 23 Nov 2014 05:10:22 +0000 (21:10 -0800)]
Use str(p) and not p.__str__()

9 years agoMerge pull request #115 from takluyver/replwrap-bash-robustness
Jeff Quast [Sat, 22 Nov 2014 20:31:21 +0000 (12:31 -0800)]
Merge pull request #115 from takluyver/replwrap-bash-robustness

Make replwrap.bash() robust against custom prompts in bashrc

9 years agoUse ternary if/else in spawn.__str__
Jeff Quast [Sat, 22 Nov 2014 20:29:15 +0000 (12:29 -0800)]
Use ternary if/else in spawn.__str__

9 years agoMerge pull request #140 from pexpect/occasionally-failing-testcases
Thomas Kluyver [Sat, 22 Nov 2014 20:05:48 +0000 (12:05 -0800)]
Merge pull request #140 from pexpect/occasionally-failing-testcases

Resolve occasionally failing testcases

9 years agouse isinstance of 'str', not 'basestring'
Jeff Quast [Sat, 22 Nov 2014 19:42:49 +0000 (11:42 -0800)]
use isinstance of 'str', not 'basestring'

9 years agoFailure in __str__() before any output.
Jeff Quast [Sat, 22 Nov 2014 19:33:55 +0000 (11:33 -0800)]
Failure in __str__() before any output.

When calling str() on a spawn class object before
it has any command output, the __str__() override
attempts to truncate long command output while the
value of self.before is still None, raising:

    TypeError: 'NoneType' object has no attribute '__getitem__'

9 years agoFix 2nd and 3rd expect/response PS1 prompt
Jeff Quast [Sat, 22 Nov 2014 08:56:13 +0000 (00:56 -0800)]
Fix 2nd and 3rd expect/response PS1 prompt

9 years agoMake sure when overriding setUp to call super's
Jeff Quast [Sat, 22 Nov 2014 08:36:58 +0000 (00:36 -0800)]
Make sure when overriding setUp to call super's

9 years agoremove TODO about ls and change to use uname
Jeff Quast [Sat, 22 Nov 2014 08:32:28 +0000 (00:32 -0800)]
remove TODO about ls and change to use uname

9 years agowrite b'bytes' to rcfile, not 'str/unicode'
Jeff Quast [Sat, 22 Nov 2014 08:31:49 +0000 (00:31 -0800)]
write b'bytes' to rcfile, not 'str/unicode'

9 years agoFix test by prevent bash from sourcing profile
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.

9 years agoChange 'ls -l /bin' test to 'uname -m -n ...'
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

9 years agoIgnore .git folder during test discovery.
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.

9 years agoRemove confusing comment in daemonize() of example/cgishell.cgi
Rick Lin [Fri, 21 Nov 2014 01:29:41 +0000 (09:29 +0800)]
Remove confusing comment in daemonize() of example/cgishell.cgi

9 years agoMerge pull request #138 from rickhau/master
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()

9 years agoRectify 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()

9 years agoMerge pull request #129 from zjx20/patch-1
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

9 years agoAdded ignore_sighup param for pxssh
zjx20 [Tue, 21 Oct 2014 01:16:16 +0000 (09:16 +0800)]
Added ignore_sighup param for pxssh

9 years agoMerge pull request #124 from h2suzuki/run-with-tuple-list-of-events
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.

9 years agoModify 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.

9 years agoAdd Pexpect development team to copyright statement
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

9 years agoMake replwrap.bash() robust against custom prompts in bashrc
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.

9 years agoMerge pull request #69 from takluyver/asyncio
Thomas Kluyver [Sun, 21 Sep 2014 19:26:54 +0000 (12:26 -0700)]
Merge pull request #69 from takluyver/asyncio

asyncio integration for expect

9 years agoStop testing on Python 2.6 and 3.2
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

9 years agoDocument asyncio integration
Thomas Kluyver [Sat, 5 Jul 2014 19:37:02 +0000 (12:37 -0700)]
Document asyncio integration

9 years agoExpose async parameter for expect_exact
Thomas Kluyver [Fri, 4 Jul 2014 00:26:42 +0000 (17:26 -0700)]
Expose async parameter for expect_exact

9 years agoCheck already read data before async reading more
Thomas Kluyver [Fri, 4 Jul 2014 00:26:15 +0000 (17:26 -0700)]
Check already read data before async reading more

9 years agoExpand tests for async expect
Thomas Kluyver [Thu, 3 Jul 2014 02:22:28 +0000 (19:22 -0700)]
Expand tests for async expect

9 years agosupport timeout in async expect
Thomas Kluyver [Thu, 3 Jul 2014 02:22:08 +0000 (19:22 -0700)]
support timeout in async expect

9 years agoFix EOF in async on Linux
Thomas Kluyver [Thu, 3 Jul 2014 02:21:07 +0000 (19:21 -0700)]
Fix EOF in async on Linux

9 years agoExpose async as parameter for expect
Thomas Kluyver [Sat, 28 Jun 2014 01:10:05 +0000 (18:10 -0700)]
Expose async as parameter for expect

9 years agoRefactor expect code
Thomas Kluyver [Sat, 28 Jun 2014 00:47:01 +0000 (17:47 -0700)]
Refactor expect code

9 years agoInitial stab at asyncio integration
Thomas Kluyver [Sat, 7 Jun 2014 01:00:20 +0000 (18:00 -0700)]
Initial stab at asyncio integration

9 years agoMerge pull request #114 from erikb85/master
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

9 years agoenable 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>
9 years agoMerge pull request #109 from pexpect/issue-86-and-100-stdin-closed
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

9 years agoadd to changelog
jquast [Thu, 28 Aug 2014 06:28:05 +0000 (23:28 -0700)]
add to changelog

9 years agoMerge pull request #99 from takluyver/issue-84
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

9 years agoCloses issue #86 and issue #100
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.

9 years agoMerge pull request #101 from BrianOn99/py3docstring
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...

9 years agoupdate documentation string in pexpect/__init__.py to be compatible with python 2...
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

9 years agoSome changes based on reviewing the code
Thomas Kluyver [Tue, 5 Aug 2014 01:08:10 +0000 (18:08 -0700)]
Some changes based on reviewing the code

9 years agoAddress review comments regarding referring to "unicode strings" in docstrings.
David O'Shea [Mon, 4 Aug 2014 05:08:34 +0000 (14:38 +0930)]
Address review comments regarding referring to "unicode strings" in docstrings.

9 years agoFix problems found in review.
David O'Shea [Mon, 4 Aug 2014 05:08:16 +0000 (14:38 +0930)]
Fix problems found in review.

9 years agoChange SPACE to be a unicode string.
David O'Shea [Sat, 2 Aug 2014 04:18:00 +0000 (13:48 +0930)]
Change SPACE to be a unicode string.

9 years agoDon't define __bytes__(), and don't define __unicode__() on Python 3.
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.

9 years agoDisable 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:40:40 +0000 (17:10 +0930)]
Disable Python 3.2 builds in Travis as changes only support 2.6, 2.7 and 3.3+.

9 years agoRename codec and codec_errors to encoding and encoding_errors respectively.
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.

9 years agoIssue #84: Unicode support in screen and ANSI.
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.

9 years agoMerge pull request #89 from dcoshea/issue-85-try2
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.

9 years agoAddress review comment (no parens around assert statement arguments).
David O'Shea [Mon, 21 Jul 2014 23:28:34 +0000 (08:58 +0930)]
Address review comment (no parens around assert statement arguments).

9 years agoMerge pull request #93 from joedougherty/patch-1
Thomas Kluyver [Fri, 18 Jul 2014 01:31:11 +0000 (20:31 -0500)]
Merge pull request #93 from joedougherty/patch-1

Update commonissues.rst

9 years agoUpdate 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.

9 years agoIssue #85: Don't leave unwanted numbers in ANSI FSM stack/memory.
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.

9 years agoMerge pull request #87 from dcoshea/issue-82
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

9 years agoIssue #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.

9 years agoMerge pull request #78 from pexpect/improve-upon-test-misc
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

9 years agoIncremental housekeeping cleanup of test_misc.py
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

9 years agoMerge pull request #76 from takluyver/replwrap-bash-set-pager
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

9 years agoAllow 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

9 years agoBump version number to 3.3
Thomas Kluyver [Thu, 26 Jun 2014 01:09:31 +0000 (18:09 -0700)]
Bump version number to 3.3

9 years agoPolish release notes
Thomas Kluyver [Thu, 26 Jun 2014 01:00:33 +0000 (18:00 -0700)]
Polish release notes

9 years agoMerge pull request #73 from pexpect/issue-44-solaris-try-3
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

9 years agoSRV4 -> SVR4
jquast [Tue, 24 Jun 2014 23:43:25 +0000 (16:43 -0700)]
SRV4 -> SVR4

see https://en.wikipedia.org/wiki/SVR4#SVR4

9 years agogah; fix constant VINTR -> INTR
jquast [Tue, 24 Jun 2014 22:08:34 +0000 (15:08 -0700)]
gah; fix constant VINTR -> INTR

9 years agoMerge branch 'issue-44-solaris-try-3' of github.com:pexpect/pexpect into issue-44...
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

9 years agoMerge branch 'issue-44-solaris-try-3' of github.com:pexpect/pexpect into issue-44...
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

9 years agoFix up except syntax again
Thomas Kluyver [Tue, 24 Jun 2014 21:35:03 +0000 (14:35 -0700)]
Fix up except syntax again

9 years agonote using py.test -- specify 'tests' folder
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.

9 years agoUse const child._VINTR instead of '3'
Jeff Quast [Tue, 24 Jun 2014 21:27:07 +0000 (21:27 +0000)]
Use const child._VINTR instead of '3'

9 years agoProvide example of SRV4-like systems
Jeff Quast [Tue, 24 Jun 2014 21:23:52 +0000 (21:23 +0000)]
Provide example of SRV4-like systems

9 years agoRefactor exceptions in __pty_make_controlling_tty
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

9 years agoMerge branch 'issue-44-solaris-try-3' of github.com:pexpect/pexpect into issue-44...
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

9 years agoMiscellaneous minor fixes
Thomas Kluyver [Mon, 16 Jun 2014 02:30:59 +0000 (19:30 -0700)]
Miscellaneous minor fixes

9 years agoImplement assertRaises and assertRaisesRegexp context managers for Python 2.6
Thomas Kluyver [Mon, 16 Jun 2014 02:26:42 +0000 (19:26 -0700)]
Implement assertRaises and assertRaisesRegexp context managers for Python 2.6

9 years agoAnother "as err" vs ", err" exception fix.
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

9 years agoMissing time import -- there is no 'waitecho' function
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?).

9 years agoSolaris support, tested on SmartOS from cron(1).
Jeff Quast [Sun, 8 Jun 2014 08:07:03 +0000 (08:07 +0000)]
Solaris support, tested on SmartOS from cron(1).

9 years agoMerge pull request #72 from pexpect/interact-does-not-detect-eof
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

9 years agoMake a modified copy of os.environ for interact tests
Thomas Kluyver [Mon, 16 Jun 2014 01:06:58 +0000 (18:06 -0700)]
Make a modified copy of os.environ for interact tests

9 years agoFor python3, exceptions should use "as err", not ", err"
jquast [Sun, 8 Jun 2014 04:45:22 +0000 (21:45 -0700)]
For python3, exceptions should use "as err", not ", err"

9 years agopython3.2 accommodations
jquast [Sun, 8 Jun 2014 04:37:36 +0000 (21:37 -0700)]
python3.2 accommodations

9 years agoDocument and detect EOF condition in interact()
jquast [Sun, 8 Jun 2014 04:35:16 +0000 (21:35 -0700)]
Document and detect EOF condition in interact()

9 years agoImprove EOF through test -> interact -> echo_prompt
jquast [Sun, 8 Jun 2014 04:25:20 +0000 (21:25 -0700)]
Improve EOF through test -> interact -> echo_prompt

9 years agoMerge pull request #70 from pexpect/more-exacting-which
Thomas Kluyver [Tue, 10 Jun 2014 19:40:22 +0000 (12:40 -0700)]
Merge pull request #70 from pexpect/more-exacting-which

new function is_exe() makes existing which() more correct

9 years agoMerge pull request #71 from pexpect/replwrap-test-fixes
Thomas Kluyver [Tue, 10 Jun 2014 19:24:52 +0000 (12:24 -0700)]
Merge pull request #71 from pexpect/replwrap-test-fixes

Fixing various prompt issues with bash ReplWrapper

9 years agoMake execute permission check more explicit
Thomas Kluyver [Tue, 10 Jun 2014 18:57:20 +0000 (11:57 -0700)]
Make execute permission check more explicit

9 years agoMinor fixes for replwrap tests
Thomas Kluyver [Tue, 10 Jun 2014 18:48:59 +0000 (11:48 -0700)]
Minor fixes for replwrap tests

9 years agoPR #66: TypeError thrown by spawnu.readline()
jquast [Mon, 9 Jun 2014 00:02:59 +0000 (17:02 -0700)]
PR #66: TypeError thrown by spawnu.readline()

Submitted by @auntieNeo, fixes exception, "TypeError:
got <type 'str'> ('\r\n') as pattern" in spawnu.readline().

Bytes b'\r\n' was concatenated to u'unicode', causing an
exception to be thrown when using readline().

9 years agosyntaxerr: missing r'literal' for unset PS1
jquast [Sun, 8 Jun 2014 09:09:48 +0000 (02:09 -0700)]
syntaxerr: missing r'literal' for unset PS1

9 years agoSolaris support, tested on SmartOS from cron(1).
Jeff Quast [Sun, 8 Jun 2014 08:07:03 +0000 (08:07 +0000)]
Solaris support, tested on SmartOS from cron(1).

9 years agoFixing various prompt issues with bash ReplWrapper
jquast [Sun, 8 Jun 2014 03:54:18 +0000 (20:54 -0700)]
Fixing various prompt issues with bash ReplWrapper

allow matching a regular expression,
use setUp and tearDown to putenv & getenv PS1, PS2
unset PROMPT_COMMAND

9 years agoProvide new 'is_exe' function used by 'which'
jquast [Sun, 8 Jun 2014 03:35:56 +0000 (20:35 -0700)]
Provide new 'is_exe' function used by 'which'

As noted by bug report http://bugs.python.org/issue14706,

"This is not a Python bug. os.access() is just a wrapper
 around the POSIX access() function"

http://pubs.opengroup.org/onlinepubs/9699919799/functions/faccessat.html

""" If any access permissions are checked, each shall be
    checked individually, as described in XBD File Access
    Permissions, except that where that description refers
    to execute permission for a process with appropriate
    privileges, an implementation may indicate success for
    X_OK even if execute permission is not granted to any
    user.
"""

9 years agoExpand on tests/test_which.py
jquast [Sun, 8 Jun 2014 03:35:05 +0000 (20:35 -0700)]
Expand on tests/test_which.py

Mainly, regarding os.defpath, os.environ['PATH'],
absolute, relative, and symlinks.

9 years agoSeparate which tests into test_which.py
jquast [Sun, 8 Jun 2014 02:47:17 +0000 (19:47 -0700)]
Separate which tests into test_which.py

9 years agoMerge branch 'interact-does-not-detect-eof' into issue-44-solaris-try-3
Jeff Quast [Fri, 6 Jun 2014 14:14:45 +0000 (14:14 +0000)]
Merge branch 'interact-does-not-detect-eof' into issue-44-solaris-try-3

9 years agoFor python3, exceptions should use "as err", not ", err"
jquast [Sun, 8 Jun 2014 04:45:22 +0000 (21:45 -0700)]
For python3, exceptions should use "as err", not ", err"