ipykernel should not assume interactive terminal
- Ngôn ngữ chính
- Python
- Star
- 734
- Fork
- 412
- Merge trung bình
- 1 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 8
Mô tả
There are a couple of places in `ipykernel` that seem assume interactive terminal
This builds automated Travis builds. See for example errors in `jupyter-incubator/sparkmagic` project in one of the PRs
https://travis-ci.org/jupyter-incubator/sparkmagic/jobs/550505401
as discussed here
https://github.com/jupyter-incubator/sparkmagic/pull/541
There are two types of exceptions in Travis logs
```
ip.showtraceback(exc_info)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 1868, in showtraceback
self._showtraceback(etype, value, stb)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/ipykernel/zmqshell.py", line 557, in _showtraceback
exc_msg = dh.session.send(dh.pub_socket, u'error', json_clean(exc_content),
AttributeError: 'NoneType' object has no attribute 'send'
```
and
```
publish_display_data(data=obj, metadata=metadata, **kwargs)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/IPython/core/display.py", line 120, in publish_display_data
**kwargs
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/ipykernel/zmqshell.py", line 128, in publish
msg = self.session.msg(
AttributeError: 'NoneType' object has no attribute 'msg'
```
I think Travis runs in a non-interactive shell that's why those things fail - notice
code path has
```
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/IPython/core/interactiveshell.py",
```
`sys.stdout.isatty()` would be false and this has to be processed in `ipykernel` / `IPython`
separately - which would indicate a non-interactive terminal (no tty).
Thank you.
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.