Replying to mpatel:
... work in Expect.quit? Then you could simplify the try block in Expect._local_tmpfile. It seems there's a tradeoff.
That was my question: Is there a tradeoff? So, now that you taught me how to deal with the double underscore attribute, I'll try to change my patch accordingly.
Could you explain where Expect.quit is called (indirectly) in your example in the description?
OK, done. quit is called in @parallel, because that decorator needs to wipe all interfaces -- but it was not rigorous enough, as it did not unset the name of the temporary file.