Skip to content

maxima interface bug caused by bad use of file when evaluating large input #1660

@williamstein

Description

@williamstein
sage: maxima.eval('plot2d([-7.5/-0.5*(x-0.5)+8,-7.5/7.5*(x-0.5)+8,-6.5/-0.5*(x-0.5)+8,-6.5/7.5*(x-0.5)+8,-5.5/-0.5*(x-0.5)+8,-5.5/7.5*(x-0.5)+8,-4.5/-0.5*(x-0.5)+8,-4.5/7.5*(x-0.5)+8,-3.5/-0.5*(x-0.5)+8,-3.5/7.5*(x-0.5)+8,-2.5/-0.5*(x-0.5)+8,-2.5/7.5*(x-0.5)+8,-1.5/-0.5*(x-0.5)+8,-1.5/7.5*(x-0.5)+8,-0.5/-0.5*(x-0.5)+8,-0.5/7.5*(x-0.5)+8],[x,0,n],[plot_format,gnuplot_pipes],[y, 0, 8],[ylabel,"y"],[gnuplot_preamble, "set grid xtics ytics"],[legend,false])')
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-1-78e2a9c764b1> in <module>()
----> 1 maxima.eval('plot2d([-7.5/-0.5*(x-0.5)+8,-7.5/7.5*(x-0.5)+8,-6.5/-0.5*(x-0.5)+8,-6.5/7.5*(x-0.5)+8,-5.5/-0.5*(x-0.5)+8,-5.5/7.5*(x-0.5)+8,-4.5/-0.5*(x-0.5)+8,-4.5/7.5*(x-0.5)+8,-3.5/-0.5*(x-0.5)+8,-3.5/7.5*(x-0.5)+8,-2.5/-0.5*(x-0.5)+8,-2.5/7.5*(x-0.5)+8,-1.5/-0.5*(x-0.5)+8,-1.5/7.5*(x-0.5)+8,-0.5/-0.5*(x-0.5)+8,-0.5/7.5*(x-0.5)+8],[x,0,n],[plot_format,gnuplot_pipes],[y, 0, 8],[ylabel,"y"],[gnuplot_preamble, "set grid xtics ytics"],[legend,false])')

/usr/local/src/sage-git/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc in eval(self, code, strip, synchronize, locals, allow_use_file, split_lines, **kwds)
   1239                 if (split_lines == "nofile" and allow_use_file and
   1240                         self._eval_using_file_cutoff and len(code) > self._eval_using_file_cutoff):
-> 1241                     return self._eval_line_using_file(code)
   1242                 elif split_lines:
   1243                     return '\n'.join([self._eval_line(L, allow_use_file=allow_use_file, **kwds)

/usr/local/src/sage-git/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc in _eval_line_using_file(self, line, restart_if_needed)
    757                 except RuntimeError as msg:
    758                     raise RuntimeError('%s terminated unexpectedly while reading in a large line'%self)
--> 759             if "Input/output error" in msg[0]: # This occurs on non-linux machines
    760                 raise RuntimeError('%s terminated unexpectedly while reading in a large line'%self)
    761             raise RuntimeError('%s terminated unexpectedly while reading in a large line:\n%s'%(self,msg[0]))

IndexError: tuple index out of range

Likely duplicates: #17388, #12360

Component: interfaces

Issue created by migration from https://trac.sagemath.org/ticket/1660

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions