<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/pexpect.git/pexpect/__init__.py, branch issue-20</title>
<subtitle>github.com: pexpect/pexpect.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/'/>
<entry>
<title>additional Nonetype timeout accomidation</title>
<updated>2014-05-25T05:47:17+00:00</updated>
<author>
<name>jquast</name>
<email>contact@jeffquast.com</email>
</author>
<published>2014-05-25T05:46:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=cccf1b3bfd47ec176c1775fedbff66fc15b3fcf9'/>
<id>cccf1b3bfd47ec176c1775fedbff66fc15b3fcf9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>resolves timeout=None parameter for read_nonblocking</title>
<updated>2014-05-25T05:40:57+00:00</updated>
<author>
<name>jquast</name>
<email>contact@jeffquast.com</email>
</author>
<published>2014-05-25T05:40:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=ef96998e5f02edb0b2c13845a60089038a49302e'/>
<id>ef96998e5f02edb0b2c13845a60089038a49302e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Issue #20: Strange EOF/TIMEOUT behavior</title>
<updated>2014-05-25T05:34:39+00:00</updated>
<author>
<name>jquast</name>
<email>contact@jeffquast.com</email>
</author>
<published>2014-05-25T05:18:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=11fca676a6b2bb29e6620fe7c096380a7bbce74b'/>
<id>11fca676a6b2bb29e6620fe7c096380a7bbce74b</id>
<content type='text'>
Problem
-------

When running a subprocess that writes a lot of data to stdout, then
exits, it is possible to read all data from stdout, then, when calling
waitpid(2), to be told the subprocess has not yet exited.

pexpect would then call read_nonblocking and block for a full 30
seconds, because there remains no more data on stdout.

Solution
--------

Add new parameter, poll_exit to read_nonblocking so that select(2) is
called at shorter intervals than previously done, but still up until
timeout specified, doing a poll for waitpid(2) at regular intervals.
This ensures that no longer than (default, 0.15) seconds elapse, instead
of the default of 30.

Testing
-------

All existing unit tests, of course. However, as a race condition, it is
not possible to reliably reproduce, it may require anywhere from 1 to 5
minutes of looping to cause it to reproduce, so it was not put into base
tests.

A simple program was authored::

   TIMEOUT=1
   def test_2():
       while True:
           stime = time.time()
           child = pexpect.spawn('ls -lR /dev',
                                 timeout=TIMEOUT)
           child.expect(pexpect.EOF)
           elapsed = time.time() - stime
           print('got eof in {0:0.2f} in pid {1}'
                 .format(elapsed, child.pid))
           assert math.floor(elapsed) &lt; TIMEOUT, elapsed

Without this change, this program will raise an exception after several
dozen runs, hitting the race condition.

With this change, I have been executing this program for several thousand
iterations without failed assertion.

PLEASE CONFER
-------------

@takluyver, with this change, I think we may also delete the
self.__irix_hack and its surrounding hack -- and even the first
self.isalive() check just before this change, for "some systems
such as Solaris" without any penalty in performance.

What do you think?
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem
-------

When running a subprocess that writes a lot of data to stdout, then
exits, it is possible to read all data from stdout, then, when calling
waitpid(2), to be told the subprocess has not yet exited.

pexpect would then call read_nonblocking and block for a full 30
seconds, because there remains no more data on stdout.

Solution
--------

Add new parameter, poll_exit to read_nonblocking so that select(2) is
called at shorter intervals than previously done, but still up until
timeout specified, doing a poll for waitpid(2) at regular intervals.
This ensures that no longer than (default, 0.15) seconds elapse, instead
of the default of 30.

Testing
-------

All existing unit tests, of course. However, as a race condition, it is
not possible to reliably reproduce, it may require anywhere from 1 to 5
minutes of looping to cause it to reproduce, so it was not put into base
tests.

A simple program was authored::

   TIMEOUT=1
   def test_2():
       while True:
           stime = time.time()
           child = pexpect.spawn('ls -lR /dev',
                                 timeout=TIMEOUT)
           child.expect(pexpect.EOF)
           elapsed = time.time() - stime
           print('got eof in {0:0.2f} in pid {1}'
                 .format(elapsed, child.pid))
           assert math.floor(elapsed) &lt; TIMEOUT, elapsed

Without this change, this program will raise an exception after several
dozen runs, hitting the race condition.

With this change, I have been executing this program for several thousand
iterations without failed assertion.

PLEASE CONFER
-------------

@takluyver, with this change, I think we may also delete the
self.__irix_hack and its surrounding hack -- and even the first
self.isalive() check just before this change, for "some systems
such as Solaris" without any penalty in performance.

What do you think?
</pre>
</div>
</content>
</entry>
<entry>
<title>Bump version number for 3.2</title>
<updated>2014-04-15T01:31:30+00:00</updated>
<author>
<name>Thomas Kluyver</name>
<email>takowl@gmail.com</email>
</author>
<published>2014-04-15T01:31:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=92debe1aa6e78cc3ee0ecd97eee1d462e313dc1a'/>
<id>92debe1aa6e78cc3ee0ecd97eee1d462e313dc1a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove workaround for bug affecting very old platforms</title>
<updated>2014-02-13T19:34:20+00:00</updated>
<author>
<name>Ed Maste</name>
<email>emaste@freebsd.org</email>
</author>
<published>2014-02-13T18:35:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=5a4ad4b882f23c07bf8b51c4ba1ed4229ee52e78'/>
<id>5a4ad4b882f23c07bf8b51c4ba1ed4229ee52e78</id>
<content type='text'>
https://github.com/pexpect/pexpect/issues/39
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/pexpect/pexpect/issues/39
</pre>
</div>
</content>
</entry>
<entry>
<title>Simplifying code to use format of select.error arguments that works in both Py27 and Py3</title>
<updated>2014-02-05T23:58:13+00:00</updated>
<author>
<name>Matthew Printz</name>
<email>matt.printz@rackspace.com</email>
</author>
<published>2014-02-05T23:58:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=4e995ddb77d7d1771a0bc79e0140b5bdff14058f'/>
<id>4e995ddb77d7d1771a0bc79e0140b5bdff14058f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixing issue where errno does not exist on select.error</title>
<updated>2014-02-04T19:16:27+00:00</updated>
<author>
<name>Matthew Printz</name>
<email>matt.printz@rackspace.com</email>
</author>
<published>2014-02-04T19:16:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=40a15faffc0a0fcb07ed4e4f2240be7bd70d6d24'/>
<id>40a15faffc0a0fcb07ed4e4f2240be7bd70d6d24</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Prepare for 3.1 release</title>
<updated>2014-01-22T18:44:23+00:00</updated>
<author>
<name>Thomas Kluyver</name>
<email>takowl@gmail.com</email>
</author>
<published>2014-01-22T18:44:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=13ec3b0e134159d0168811862a9d7980847ca4e0'/>
<id>13ec3b0e134159d0168811862a9d7980847ca4e0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #31 from takluyver/stdout-bytes-py3</title>
<updated>2014-01-07T23:08:07+00:00</updated>
<author>
<name>Thomas Kluyver</name>
<email>takowl@gmail.com</email>
</author>
<published>2014-01-07T23:08:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=693cb29ec3e5a55304720e73553b57d7c0c66f8f'/>
<id>693cb29ec3e5a55304720e73553b57d7c0c66f8f</id>
<content type='text'>
Allow importing when sys.stdout is reassigned on Python 3</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allow importing when sys.stdout is reassigned on Python 3</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #34 from offby1/master</title>
<updated>2014-01-07T22:21:22+00:00</updated>
<author>
<name>Thomas Kluyver</name>
<email>takowl@gmail.com</email>
</author>
<published>2014-01-07T22:21:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=0b99c3a5fd34c68a58ec4ea07f4957579133e6f7'/>
<id>0b99c3a5fd34c68a58ec4ea07f4957579133e6f7</id>
<content type='text'>
ExceptionPexpect.__init__: invoke super's init</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ExceptionPexpect.__init__: invoke super's init</pre>
</div>
</content>
</entry>
</feed>
