Hi!

Occasionally, in particular if the hard disk is slow or the computer's
workload is heavy, I observe errors of the following kind:

      File "/scratch/sking/sage-4.5.1-Solaris_10_SPARC-sun4u-SunOS/
local/lib/python/site-packages/sage/interfaces/expect.py", line 1032,
in __call__
        return cls(self, x, name=name)
      File "/scratch/sking/sage-4.5.1-Solaris_10_SPARC-sun4u-SunOS/
local/lib/python/site-packages/sage/interfaces/expect.py", line 1451,
in __init__
        raise TypeError, x
    TypeError: Unexpected EOF from Gap executing Read("/home/
SimonKing/.sage//temp/t2/26058//interface//tmp26058");

Similar errors occur for the Singular interface, and it is not only on
t2.

Could it be that the expect interface does not wait and tries to read
from the temporary file before it is completed?

I guess the relevant bit of code is in expect.py, namely line 612ff:
    def _eval_line_using_file(self, line):
        F = open(self._local_tmpfile(), 'w')
        F.write(line+'\n')
        F.close()
        tmp_to_use = self._local_tmpfile()
        if self.is_remote():
            self._send_tmpfile_to_server()
            tmp_to_use = self._remote_tmpfile()
        try:
            s =
self._eval_line(self._read_in_file_command(tmp_to_use),
allow_use_file=False)
        ...

I would expect that F.close() waits until the file F really is closed,
but perhaps I am mistaken?

Anyway, it does occasionally happen to me (but it is hardly
reproducible) that the temporary file is mutilated when
self._eval_line(self._read_in_file_command(tmp_to_use),
allow_use_file=False) is executed. Is there a way to test whether the
creation of the file succeeded (and wait if it isn't done yet), before
trying to read it?

Best regards,
Simon

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to