blink1073 / scilab2py

[Deprecated] Python to Scilab Bridge
http://blink1073.github.io/scilab2py/
Other
7 stars 5 forks source link

SciLab2Py.push() times out #15

Open maltekliemann opened 4 years ago

maltekliemann commented 4 years ago

Running following script results in a timeout, or sleeps indefinetly if no timeout is used:

from scilab2py import Scilab2Py

sci = Scilab2Py()
sci.push('a', 0, verbose=True, timeout=1) 

The traceback is

Traceback (most recent call last):
  File "poc.py", line 14, in <module>
    scilab.push('foo', 1, verbose=True, timeout=1)
  File "/Users/malte/.pyenv/versions/3.7.6/lib/python3.7/site-packages/scilab2py/core.py", line 148, in push
    self.eval(load_line, verbose=verbose, timeout=timeout)
  File "/Users/malte/.pyenv/versions/3.7.6/lib/python3.7/site-packages/scilab2py/core.py", line 291, in eval
    post_call=post_call)
  File "/Users/malte/.pyenv/versions/3.7.6/lib/python3.7/site-packages/scilab2py/core.py", line 735, in evaluate
    self.expect(chr(2))
  File "/Users/malte/.pyenv/versions/3.7.6/lib/python3.7/site-packages/scilab2py/core.py", line 781, in expect
    line = self.readline(timeout)
  File "/Users/malte/.pyenv/versions/3.7.6/lib/python3.7/site-packages/scilab2py/core.py", line 806, in readline
    raise Scilab2PyError('Timed out')
scilab2py.utils.Scilab2PyError: Timed out
make: *** [default] Error 1

In fact, execution is stuck in the try block of _Session.readline().

The log contains the following logging.DEBUG message:

2020-04-02 11:42:43,988 - simple_example - INFO - loadmatfile /var/folders/61/mf6sr7b900jcmtd_dfw_z_rr0000gn/T/tmp4yaxfupb.mat "a"
2020-04-02 11:42:43,988 - simple_example - DEBUG - 

        h = gdf();
         h.figure_position = [0, 0];
         h.figure_size = [620,590];
         h.axes_size = [620 * 0.98, 590 * 0.8];

        clear("ans");
        clear("a__");
        clear("_ans");

        try
            disp(char(2));
            loadmatfile /var/folders/61/mf6sr7b900jcmtd_dfw_z_rr0000gn/T/tmp4yaxfupb.mat "a"
            if exists("ans") == 1 then
               _ans = ans;
            end
        catch
            disp(lasterror());
            disp(char(24));
        end

        if exists("_ans") == 1
            if type(_ans) == 4 then
                   _ans = double(_ans)
            end
            if or(type(_ans) == [1,2,3,5,6,7,8,10]) then
                    if exists("a__") == 0 then
                        try
                            savematfile -v6 /var/folders/61/mf6sr7b900jcmtd_dfw_z_rr0000gn/T/tmpcz77_41q.mat _ans;
                        catch
                            disp(_ans)
                        end
                    end
                elseif type(_ans)
                    disp(_ans);
                end
        end

        disp(char(3))

Other calls to methods of Scilab2Py do not result in any response either. Running scilab scripts directly works fine, so I blame scilab2py.

I've tested this with scilab2py 0.6.2 on macOS Catalina 10.15.4 (python 3.7.6, scilab 6.0.1), Windows 10 (python 3.8.2, scilab 6.1.0) and Ubunu 18.04 (python 3.7.5, Scilab 6.1.0). Results remain the same throughout.

Is there any indication for what might cause this?

blink1073 commented 4 years ago

Hi @maltekliemann, I haven't used Scilab in quite some time and don't have the bandwidth to support this package any longer.