Open kracekumar opened 8 years ago
@kracekumar - This is totally a guess at this point; I suspect the issue maybe due to redirecting stdout within EzhilFileExecuter which Django may depend upon. This gets hairy and complicated really quickly.
We need to find a way to perform the ezhil evaluate operation within the Django call stack, and not worry about the infinite-loop cases, which Django timeouts can resolve.
Basically the alternative at this point is to write code like,
import ezhil
output = ezhil.eval( " ... code ... ")
return output
Ofcourse this function ezhil.eval() does not exist in the same form today, whereas we have ezhil.start(). So some amount of refactoring will help.
I have django view which calls following function to execute the code.
The view properly decodes the json data and output is
The
code
value isu'\nz = dict()\n\u0bb5\u0bc8(z, "name", "Tamil")\n\u0baa\u0ba4\u0bbf\u0baa\u0bcd\u0baa\u0bbf keys(z)\n'
The api is called using
requests
.Here is the output when
debug=True
But executing same code in interpreter produces proper output
I am using
Python 2.7.10
,ezhil
is installed bypython setup.py develop
,git+git@github.com:kracekumar/Ezhil-Lang.git@5738b1178355bcb886e4af4331932f3020fce625#egg=ezhil-master
Looks like something silly I am doing. Any help ?