#10295: Upgrading pexpect
-------------------------------------+-------------------------------------
       Reporter:  SimonKing          |        Owner:  was
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.10
      Component:  interfaces         |   Resolution:
       Keywords:  pexpect upgrade    |    Merged in:
        Authors:  François Bissey,   |    Reviewers:  Jeroen Demeyer
  Bill Page                          |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  de71ef81f8acac4c3dd2219d87de897c965fc11a
  u/jdemeyer/pexpect3.3              |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by fbissey):

 I asked upstream for guidance, this is what they have to say so far:
 When the `PtyProcess` instance (`self.ptyproc` on a `Pexpect` spawn
 instance) is garbage collected, it will indeed close the file descriptor.
 But I don't see how that could have happened when you're still calling
 `E.sendline()` - clearly there is still a reference to the object, so it
 shouldn't be garbage collected.

 Could something else be closing an fd explicitly? I have run into odd
 effects before because the numbers representing fds are readily reused. If
 one fd gets closed while its corresponding 'handle' object (e.g. a
 `PtyProcess` instance) still exists, when the handle object is garbage
 collected, it may close an unrelated file which has been opened in the
 meantime:


 {{{
 A =  open('foo')
 # handle A with fd=5
 os.close(5)
 B = open('bar')
 # handle A with fd=5
 # handle B with fd=5
 del A
 # handle A is garbage collected, closing fd 5
 B.read()
 # Bad fd!
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/10295#comment:119>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to