Repository: spyder-ide/spyder

Issue:
TypeError when switching to plain text mode in Help for an object with no help
## Description

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

I am trying to import sklearn.preprocessing import Imputer Module.But it showing as Imputer module not found and also facing while setting parameters in Imputer object

### Traceback
```python-traceback
  File "C:\Users\Akash\anaconda3\lib\site-packages\spyder\plugins\editor\widgets\editor.py", line 1070, in display_help
    self.send_to_help(name, help_text, force=True)
  File "C:\Users\Akash\anaconda3\lib\site-packages\spyder\plugins\editor\widgets\editor.py", line 2626, in send_to_help
    self.help.set_editor_doc(doc, force_refresh=force)
  File "C:\Users\Akash\anaconda3\lib\site-packages\spyder\plugins\help\plugin.py", line 533, in set_editor_doc
    self.set_plain_text(doc, is_code=False)
  File "C:\Users\Akash\anaconda3\lib\site-packages\spyder\plugins\help\plugin.py", line 373, in set_plain_text
    '\n'])
TypeError: sequence item 1: expected str instance, NoneType found
```

## Versions

* Spyder version: 4.0.1 
* Python version: 3.7.6
* Qt version: 5.9.6
* PyQt5 version: 5.9.2
* Operating System: Windows 10

### Dependencies

```
atomicwrites >=1.2.0         :  1.3.0 (OK)
chardet >=2.0.0              :  3.0.4 (OK)
cloudpickle >=0.5.0          :  1.3.0 (OK)
diff_match_patch >=20181111  :  20181111 (OK)
intervaltree                 :  None (OK)
IPython >=4.0                :  7.12.0 (OK)
jedi =0.14.1                 :  0.14.1 (OK)
nbconvert >=4.0              :  5.6.1 (OK)
numpydoc >=0.6.0             :  0.9.2 (OK)
pexpect >=4.4.0              :  4.8.0 (OK)
pickleshare >=0.4            :  0.7.5 (OK)
psutil >=0.3                 :  5.6.7 (OK)
pygments >=2.0               :  2.5.2 (OK)
pylint >=0.25                :  2.4.4 (OK)
pyls >=0.31.2;<0.32.0        :  0.31.7 (OK)
zmq >=17                     :  18.1.1 (OK)
qdarkstyle >=2.7             :  2.8 (OK)
qtawesome >=0.5.7            :  0.6.1 (OK)
qtconsole >=4.6.0            :  4.6.0 (OK)
qtpy >=1.5.0                 :  1.9.0 (OK)
rtree >=0.8.3                :  0.9.3 (OK)
sphinx >=0.6.6               :  2.4.0 (OK)
spyder_kernels >=1.8.1;<2.0.0:  1.8.1 (OK)
watchdog                     :  None (OK)
cython >=0.21                :  0.29.15 (OK)
matplotlib >=2.0.0           :  3.1.3 (OK)
numpy >=1.7                  :  1.18.1 (OK)
pandas >=0.13.1              :  1.0.1 (OK)
scipy >=0.17.0               :  1.4.1 (OK)
sympy >=0.7.3                :  1.5.1 (OK)
```



Discussion:
@AkashSabat, thanks for reporting. This is a real issue.

@steff456, please take a look at this one. The problem appears when you try to get help for an object in the editor with no available docstring (e.g. `sklearn.preprocessing import Imputer`) and then switch to plain text mode here:

![Selección_001](https://user-images.githubusercontent.com/365293/79076271-69ddde80-7cbe-11ea-966a-0d4b2d5dc6f8.png)

So you need to capture the error and show in plain text mode the same string, i.e. "No documentation available".

Resolving patch:
diff --git a/spyder/plugins/help/plugin.py b/spyder/plugins/help/plugin.py
--- a/spyder/plugins/help/plugin.py
+++ b/spyder/plugins/help/plugin.py
@@ -370,16 +370,19 @@ def set_plain_text(self, text, is_code):
                                     '='*len(name), '\n\n'])
             else:
                 rst_title = ''
-
-            if text['argspec']:
-                definition = ''.join(['Definition: ', name, text['argspec'],
-                                      '\n'])
-            else:
-                definition = ''
-
-            if text['note']:
-                note = ''.join(['Type: ', text['note'], '\n\n----\n\n'])
-            else:
+            try:
+                if text['argspec']:
+                    definition = ''.join(
+                        ['Definition: ', name, text['argspec'], '\n\n'])
+                else:
+                    definition = ''
+
+                if text['note']:
+                    note = ''.join(['Type: ', text['note'], '\n\n----\n\n'])
+                else:
+                    note = _('No further documentation available')
+            except TypeError:
+                definition = _('No documentation available')
                 note = ''
 
             full_text = ''.join([rst_title, definition, note,


Test patch: