<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/pexpect.git, branch issue-20-try-2</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>more naughty attempts, cleaning up, as not to lose</title>
<updated>2014-05-25T16:20:33+00:00</updated>
<author>
<name>jquast</name>
<email>contact@jeffquast.com</email>
</author>
<published>2014-05-25T16:20:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=e4d63327d2d4890b1ef549f87f0a137e6fa7eb94'/>
<id>e4d63327d2d4890b1ef549f87f0a137e6fa7eb94</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-25T06:34:48+00:00</updated>
<author>
<name>jquast</name>
<email>contact@jeffquast.com</email>
</author>
<published>2014-05-25T06:29:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=78b16ad8f06ce20b5274a7a7c17f3a8a042edd46'/>
<id>78b16ad8f06ce20b5274a7a7c17f3a8a042edd46</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
-------

Includes travis changes for python3.4, also disabling use_site_packages
which doesn't appear supported any longer (most builds have been failing
for some time). Additionally, a 'death' flag for checking select(2)
after waitpid(2) was necessary only for python3.4 on travis, i could not
reproduce locally.

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
-------

Includes travis changes for python3.4, also disabling use_site_packages
which doesn't appear supported any longer (most builds have been failing
for some time). Additionally, a 'death' flag for checking select(2)
after waitpid(2) was necessary only for python3.4 on travis, i could not
reproduce locally.

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>Merge pull request #53 from takluyver/rm-install-doc</title>
<updated>2014-05-13T18:57:04+00:00</updated>
<author>
<name>Thomas Kluyver</name>
<email>takowl@gmail.com</email>
</author>
<published>2014-05-13T18:57:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=c4359ad421a6d75a4b8859f7fdcb21c568173865'/>
<id>c4359ad421a6d75a4b8859f7fdcb21c568173865</id>
<content type='text'>
Remove out of date INSTALL doc</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove out of date INSTALL doc</pre>
</div>
</content>
</entry>
<entry>
<title>Remove out of date INSTALL doc</title>
<updated>2014-05-13T18:49:46+00:00</updated>
<author>
<name>Thomas Kluyver</name>
<email>takowl@gmail.com</email>
</author>
<published>2014-05-13T18:48:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=cd7514fc2064bda4db9fd04e455e42f6381eb590'/>
<id>cd7514fc2064bda4db9fd04e455e42f6381eb590</id>
<content type='text'>
Closes gh-52
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes gh-52
</pre>
</div>
</content>
</entry>
<entry>
<title>Add long description (copied part of README)</title>
<updated>2014-04-15T01:34:32+00:00</updated>
<author>
<name>Thomas Kluyver</name>
<email>takowl@gmail.com</email>
</author>
<published>2014-04-15T01:34:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=afebd40190b443a818d713aa17c7a28a8d0b97cc'/>
<id>afebd40190b443a818d713aa17c7a28a8d0b97cc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</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>Add release notes for 3.2</title>
<updated>2014-04-14T00:45:31+00:00</updated>
<author>
<name>Thomas Kluyver</name>
<email>takowl@gmail.com</email>
</author>
<published>2014-04-14T00:45:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=a39f9b4773cf88e7a9eadea84de9a653c72a1553'/>
<id>a39f9b4773cf88e7a9eadea84de9a653c72a1553</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 #43 from pexpect/issue-42-cannot-implicit-bytes-to-str</title>
<updated>2014-03-08T01:28:15+00:00</updated>
<author>
<name>Jeff Quast</name>
<email>contact@jeffquast.com</email>
</author>
<published>2014-03-08T01:28:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=fcf4ad9b744f845b9c88f63c735ff686f24381e2'/>
<id>fcf4ad9b744f845b9c88f63c735ff686f24381e2</id>
<content type='text'>
closes issue #42, self.buffer decoded implicitly</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
closes issue #42, self.buffer decoded implicitly</pre>
</div>
</content>
</entry>
<entry>
<title>display expected prompt as PROMPT, not PROMPT_SET_SH</title>
<updated>2014-03-08T01:22:01+00:00</updated>
<author>
<name>jquast</name>
<email>contact@jeffquast.com</email>
</author>
<published>2014-03-08T01:22:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=2ba85516dd2b95bab1674becc42326df72265d0c'/>
<id>2ba85516dd2b95bab1674becc42326df72265d0c</id>
<content type='text'>
completes issue #44; thanks to @takluyver for keen eye.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
completes issue #44; thanks to @takluyver for keen eye.
</pre>
</div>
</content>
</entry>
<entry>
<title>assertRaises is not 2.6-&gt;3.x compatible</title>
<updated>2014-03-07T07:05:43+00:00</updated>
<author>
<name>jquast</name>
<email>contact@jeffquast.com</email>
</author>
<published>2014-03-07T07:05:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=0600cbc0d356cfa2e2fbcf2428214726085b19e2'/>
<id>0600cbc0d356cfa2e2fbcf2428214726085b19e2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
