Repository: spyder-ide/spyder

Issue:
object.[tab] causes internal error in IPython console
## Description

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

In IPthon console...
import html as H
H.(tab) i.e. hitting tab for info after period results in internal error

Also, there is no automatic usage info displayed once I enter "dot", H.

UPDATE: This occurs NO MATTER what module.object I import.


### Traceback
```python-traceback
  File "/home/brianw/anaconda3/lib/python3.7/site-packages/qtconsole/base_frontend_mixin.py", line 138, in _dispatch
    handler(msg)
  File "/home/brianw/anaconda3/lib/python3.7/site-packages/qtconsole/jupyter_widget.py", line 178, in _handle_complete_reply
    self._complete_with_items(cursor, matches)
  File "/home/brianw/anaconda3/lib/python3.7/site-packages/qtconsole/console_widget.py", line 1054, in _complete_with_items
    prefix_length=len(prefix))
  File "/home/brianw/anaconda3/lib/python3.7/site-packages/qtconsole/completion_html.py", line 313, in show_items
    displaywidth = int(max(10, (width / char_width) - 1))
ZeroDivisionError: float division by zero
```

## Versions

* Spyder version: 4.1.5 
* Python version: 3.7.6
* Qt version: 5.9.6
* PyQt5 version: 5.9.2
* Operating System: Linux 5.4.0-47-generic

### Dependencies

```

# Mandatory:
atomicwrites >=1.2.0           :  1.4.0 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  1.6.0 (OK)
diff_match_patch >=20181111    :  20200713 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.18.1 (OK)
jedi =0.17.1                   :  0.17.1 (OK)
keyring                        :  None (OK)
nbconvert >=4.0                :  5.6.1 (OK)
numpydoc >=0.6.0               :  1.1.0 (OK)
parso =0.7.0                   :  0.7.0 (OK)
pexpect >=4.4.0                :  4.8.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.7.2 (OK)
pygments >=2.0                 :  2.6.1 (OK)
pylint >=1.0                   :  2.6.0 (OK)
pyls >=0.34.0;<1.0.0           :  0.34.1 (OK)
qdarkstyle >=2.8               :  2.8.1 (OK)
qtawesome >=0.5.7              :  0.7.2 (OK)
qtconsole >=4.6.0              :  4.7.6 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
rtree >=0.8.3                  :  0.9.4 (OK)
sphinx >=0.6.6                 :  3.2.1 (OK)
spyder_kernels >=1.9.4;<1.10.0 :  1.9.4 (OK)
watchdog                       :  None (OK)
xdg >=0.26                     :  0.26 (OK)
zmq >=17                       :  19.0.1 (OK)

# Optional:
cython >=0.21                  :  0.29.21 (OK)
matplotlib >=2.0.0             :  3.3.1 (OK)
numpy >=1.7                    :  1.19.1 (OK)
pandas >=0.13.1                :  1.1.1 (OK)
scipy >=0.17.0                 :  1.5.2 (OK)
sympy >=0.7.3                  :  1.6.2 (OK)
```



Discussion:
Not a spyder bug. Same will occur in jupyter qtconsole. Update to qtconsole 4.7.7 
https://github.com/jupyter/qtconsole/issues/437
Thanks for pointing out the cause @bnavigator.

@steff456, since this is a very serious error, let's increase our minimal required version for qtconsole to `4.7.7`. You need to do that in the following files:

* setup.py
* spyder/dependencies.py
* requirements/conda.txt
* binder/environment.yml

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -229,7 +229,7 @@ def run(self):
     'pyzmq>=17',
     'qdarkstyle>=2.8',
     'qtawesome>=0.5.7',
-    'qtconsole>=4.6.0',
+    'qtconsole>=4.7.7',
     'qtpy>=1.5.0',
     'sphinx>=0.6.6',
     'spyder-kernels>=1.9.4,<1.10.0',
diff --git a/spyder/dependencies.py b/spyder/dependencies.py
--- a/spyder/dependencies.py
+++ b/spyder/dependencies.py
@@ -52,7 +52,7 @@
 PYZMQ_REQVER = '>=17'
 QDARKSTYLE_REQVER = '>=2.8'
 QTAWESOME_REQVER = '>=0.5.7'
-QTCONSOLE_REQVER = '>=4.6.0'
+QTCONSOLE_REQVER = '>=4.7.7'
 QTPY_REQVER = '>=1.5.0'
 RTREE_REQVER = '>=0.8.3'
 SPHINX_REQVER = '>=0.6.6'


Test patch: