-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python evaluator fixes. #837
Conversation
Debugging, trying to figure out what's actually going on in here.
Clearly, this cannot work when there are infinite loops, agents or threads -- one could wait forever to see any print output. Meanwhile, the size of buffers grows without bound, as observed in comment opencog/opencog#2301 (comment)
Regarding interrupting python ... I don't know the detailed context of the http://effbot.org/zone/stupid-exceptions-keyboardinterrupt.htm to make some python game I was writing be stoppable via control-C Probably not applicable; just quasi-randomly brainstorming... ... ben On Mon, Jul 25, 2016 at 11:04 PM, Linas Vepštas notifications@github.com
Ben Goertzel, PhD Super-benevolent super-intelligence is the thought the Global Brain is |
btw it seems that this breaks the nlp-parse...
|
When removing all empty lines from function |
For this specific problem it looks like the following commit is causing troubles 8dda9e4 But there are other python errors, such as |
if (0 == part_size and | ||
'\n' != partial_expr[0] and | ||
'\r' != partial_expr[0]) | ||
goto wait_for_more; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@linas I don't understand what you want to fix here, the former code (0 < partion_exp.size())
looks perfectly good to me. The problem with your fix is that the following code
def fun(x):
y = x + 1
return y
fails because return y
is considered part of a subsequent block.
I believe that this will partially alleviate the problem described in opencog/opencog#2311 and in opencog/opencog#2315 and in opencog/opencog#2301 and in particular, Misgana's comment opencog/opencog#2301 (comment)
Basically, the way python was handling printing could not possibly work for anything that ran a python agent, or ran for a long time before returning. Right now, prints will always go to the cogserver stdout -- that will be recaptured in a different pull for the cogserver.
I cannot figure out how to interrupt python, so if you create an infinite loop, the only way to stop it is to kill the cogserver.