atomspace icon indicating copy to clipboard operation
atomspace copied to clipboard

Python: coserver shell handling is broken. opencog/cogserver#3

Open linas opened this issue 5 years ago • 4 comments

Python printing in the cogserver shell is (was??) broken, due to changes in PythonEval in the atomspace. For details, see opencog/cogserver#3

linas avatar Dec 02 '19 17:12 linas

@noskill @vsbogd fyi

linas avatar Dec 02 '19 17:12 linas

See also opencog/cogserver#2 which might be a duplicate

linas avatar Dec 02 '19 17:12 linas

Why cogserver uses PythonEval from atomspace? It can just call PyRun_InteractiveLoopFlags

noskill avatar Dec 06 '19 14:12 noskill

Why?

History, I suppose. And simplicity. The Shell class is a generic class that takes one line of text input from, runs it, and then returns a text string. So it will work for "anything", and attaching it to PythonEval was easy.

We don''t quite have a good way of handing off the whole interactive loop to some handler; this is mostly due to the complexity of using boost::asio (which I'm unhappy about, because its .. complex, hard to use, and buggy.) I don't think it has an API where it can just hand off a socket to someone else to manage.

The cogserver python shell was used to communicate with ROS (since ROS is 90% python) but I don't think there are many (or any) unit tests for it.

linas avatar Dec 06 '19 16:12 linas