gregsexton / ob-ipython

org-babel integration with Jupyter for evaluation of (Python by default) code blocks
739 stars 109 forks source link

ob-ipython-inspect causes tornado to throw "Internal server error"; json.decoder? #64

Closed singletS closed 7 years ago

singletS commented 8 years ago

Since ipython/jupyter upgrade, ob-ipython-inspect causes "Internal server error". Traceback from the ob-ipython-client-driver buffer suggests a missing/non-escaped character in json.decoder?

Traceback (most recent call last):
  File "/home/anaconda3/lib/python3.5/site-packages/tornado/web.py", line 1401, in _stack_context_handle_exception
    raise_exc_info((type, value, traceback))
  File "<string>", line 3, in raise_exc_info
  File "/home/anaconda3/lib/python3.5/site-packages/tornado/web.py", line 1603, in wrapper
    result = method(self, *args, **kwargs)
  File "/home/.emacs.d/elpa/ob-ipython-20160424.1305/driver.py", line 104, in post
    req = json.loads(self.request.body.decode("utf-8"))
  File "/home/anaconda3/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/home/anaconda3/lib/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/anaconda3/lib/python3.5/json/decoder.py", line 355, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 9 (char 8)
ERROR:tornado.access:500 POST /inspect/default (::1) 3.20ms

$ ipython --version
4.2.0

$ jupyter --version 
4.1.0
fleimgruber commented 7 years ago

Have you tried again with the latest version(s)? This looks more like an IPython/Jupyter issue. ob-ipython-inspect does work with IPython 5.1.0 over here.

singletS commented 7 years ago

Thanks for the update. I'm glad to hear this is working with newer IPython, though I haven't tried it myself (migrated over to the scimax/emacs environment).