Repository: spyder-ide/spyder

Issue:
Error when searching numpy and pandas in Online Help widget
## Description

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

Entering `numpy` (or `pandas`) in the Online Help widget search field results in an error similar to the following.
```
numpy.html
AssertionError
```

Also, entering any text in the "Module Index:Topics:Keywords" search field results in an error, for example
```
search?key=bootstrap
OSError: The baseline image directory does not exist. This is most likely because the test data is not installed. You may need to install matplotlib from source to get the test data.
```

Screenshots below illustrate the errors. The last screenshot illustrates successful search of `matplotlib`.
<img width="500" alt="Screenshot 2023-04-24 at 9 23 58 AM" src="https://user-images.githubusercontent.com/9618975/234059611-8bff99ac-dea0-4de7-b26e-e3d227dde978.png">
<img width="500" alt="Screenshot 2023-04-24 at 9 25 05 AM" src="https://user-images.githubusercontent.com/9618975/234059615-cd0c3911-d1c4-477e-bf3e-9e74f287ab76.png">
<img width="500" alt="Screenshot 2023-04-24 at 9 23 42 AM" src="https://user-images.githubusercontent.com/9618975/234059601-ff4f9d0a-f9e4-4a25-bfea-001917a5b1c6.png">



## Versions

* Spyder version: 5.5.0.dev0 00ebc4ad5 (conda)
* Python version: 3.10.10 64-bit
* Qt version: 5.15.6
* PyQt5 version: 5.15.7
* Operating System: Darwin 22.4.0

### Dependencies

```
# Mandatory:
applaunchservices >=0.3.0                        :  0.3.0 (OK)
atomicwrites >=1.2.0                             :  1.4.1 (OK)
chardet >=2.0.0                                  :  5.1.0 (OK)
cloudpickle >=0.5.0                              :  2.2.1 (OK)
cookiecutter >=1.6.0                             :  2.1.1 (OK)
diff_match_patch >=20181111                      :  20200713 (OK)
intervaltree >=3.0.2                             :  3.0.2 (OK)
IPython >=7.31.1,<9.0.0,!=8.8.0,!=8.9.0,!=8.10.0 :  8.12.0 (OK)
jedi >=0.17.2,<0.19.0                            :  0.18.2 (OK)
jellyfish >=0.7                                  :  0.9.0 (OK)
jsonschema >=3.2.0                               :  4.17.3 (OK)
keyring >=17.0.0                                 :  23.13.1 (OK)
nbconvert >=4.0                                  :  7.3.1 (OK)
numpydoc >=0.6.0                                 :  1.5.0 (OK)
parso >=0.7.0,<0.9.0                             :  0.8.3 (OK)
pexpect >=4.4.0                                  :  4.8.0 (OK)
pickleshare >=0.4                                :  0.7.5 (OK)
psutil >=5.3                                     :  5.9.4 (OK)
pygments >=2.0                                   :  2.15.0 (OK)
pylint >=2.5.0,<3.0                              :  2.17.2 (OK)
pylint_venv >=2.1.1                              :  3.0.1 (OK)
pyls_spyder >=0.4.0                              :  0.4.0 (OK)
pylsp >=1.7.2,<1.8.0                             :  1.7.2 (OK)
pylsp_black >=1.2.0                              :  1.2.1 (OK)
qdarkstyle >=3.0.2,<3.2.0                        :  3.1 (OK)
qstylizer >=0.2.2                                :  0.2.2 (OK)
qtawesome >=1.2.1                                :  1.2.3 (OK)
qtconsole >=5.4.2,<5.5.0                         :  5.5.0.dev0 (OK)
qtpy >=2.1.0                                     :  2.3.1 (OK)
rtree >=0.9.7                                    :  1.0.1 (OK)
setuptools >=49.6.0                              :  67.6.1 (OK)
sphinx >=0.6.6                                   :  6.1.3 (OK)
spyder_kernels >=2.4.3,<2.5.0                    :  2.5.0.dev0 (OK)
textdistance >=4.2.0                             :  4.5.0 (OK)
three_merge >=0.1.1                              :  0.1.1 (OK)
watchdog >=0.10.3                                :  3.0.0 (OK)
zmq >=22.1.0                                     :  25.0.2 (OK)

# Optional:
cython >=0.21                                    :  0.29.34 (OK)
matplotlib >=3.0.0                               :  3.7.1 (OK)
numpy >=1.7                                      :  1.24.2 (OK)
pandas >=1.1.1                                   :  2.0.0 (OK)
scipy >=0.17.0                                   :  1.10.1 (OK)
sympy >=0.7.3                                    :  1.11.1 (OK)
```



Discussion:
@mrclary, perhaps this is too much to ask, but could you take a look at this issue?
So far, narrowed it down to an issue in `spyder.plugins.onlinehelp.pydoc_patch._start_server` or `_url_handler`. Using `pydoc._start_server` and `pydoc._url_handler` does not manifest the issue.
Investigation continues.

---

Narrowed down to `spyder.plugins.onlinehelp.pydoc_patch._url_handler`

Resolving patch:
diff --git a/spyder/plugins/onlinehelp/pydoc_patch.py b/spyder/plugins/onlinehelp/pydoc_patch.py
--- a/spyder/plugins/onlinehelp/pydoc_patch.py
+++ b/spyder/plugins/onlinehelp/pydoc_patch.py
@@ -473,6 +473,8 @@ def spilldata(msg, attrs, predicate):
                           lambda t: t[1] == 'class method')
             attrs = spill('Static methods %s' % tag, attrs,
                           lambda t: t[1] == 'static method')
+            attrs = spilldescriptors("Readonly properties %s" % tag, attrs,
+                                     lambda t: t[1] == 'readonly property')
             attrs = spilldescriptors('Data descriptors %s' % tag, attrs,
                                      lambda t: t[1] == 'data descriptor')
             attrs = spilldata('Data and other attributes %s' % tag, attrs,
@@ -717,7 +719,9 @@ def callback(path, modname, desc):
 
         with warnings.catch_warnings():
             warnings.filterwarnings('ignore')  # ignore problems during import
-            ModuleScanner().run(callback, key)
+            def onerror(modname):
+                pass
+            ModuleScanner().run(callback, key, onerror=onerror)
 
         # format page
         def bltinlink(name):


Test patch:
diff --git a/spyder/plugins/onlinehelp/tests/test_pydocgui.py b/spyder/plugins/onlinehelp/tests/test_pydocgui.py
--- a/spyder/plugins/onlinehelp/tests/test_pydocgui.py
+++ b/spyder/plugins/onlinehelp/tests/test_pydocgui.py
@@ -43,16 +43,9 @@ def pydocbrowser(qtbot):
 @pytest.mark.order(1)
 @pytest.mark.parametrize(
     "lib",
-    [('str', 'class str', [0, 1]), ('numpy.testing', 'numpy.testing', [5, 10])]
-)
-@pytest.mark.skipif(
-    (sys.platform == 'darwin' or
-     NumpyVersion(np.__version__) < NumpyVersion('1.21.0')),
-    reason="Fails on Mac and older versions of Numpy"
-)
-@pytest.mark.skipif(
-    sys.platform.startswith('linux') or os.name == 'nt' and running_in_ci(),
-    reason="Stalls CI frequenly on Linux and Windows"
+    [('str', 'class str', [1, 2]),
+     ('numpy.testing', 'numpy.testing', [5, 10]),
+     ('numpy.finfo', 'numpy.finfo', [1, 5])]
 )
 def test_get_pydoc(pydocbrowser, qtbot, lib):
     """