I am debugging a pexpect interface issue at http://trac.sagemath.org/ticket/17686 When creating an Expect object, say "g = Gp()", doing "del g" afterwards doesn't actually destroy the object, even if followed by "gc.collect()".

I want to understand why, in particular who keeps these Expect objects alive. sage.interfaces.quit (used to implement quitting interfaces when Sage quits) keeps weakrefs, so that cannot be the problem.

Example Sage session:

sage: for i in range(10):
    print Gp().eval("2")
....:
2
2
2
2
2
2
2
2
2
2
sage: import gc; gc.collect()
52
sage:
Exiting Sage (CPU time 0m0.22s, Wall time 0m9.04s).
Exiting spawned PARI/GP interpreter process.
Exiting spawned PARI/GP interpreter process.
Exiting spawned PARI/GP interpreter process.
Exiting spawned PARI/GP interpreter process.
Exiting spawned PARI/GP interpreter process.
Exiting spawned PARI/GP interpreter process.
Exiting spawned PARI/GP interpreter process.
Exiting spawned PARI/GP interpreter process.
Exiting spawned PARI/GP interpreter process.
Exiting spawned PARI/GP interpreter process.

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

Reply via email to