Repository: spyder-ide/spyder

Issue:
FileNotFoundError in Online help
## Description

### What steps will reproduce the problem?

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

- **Step 1 :** Open `Online help`
- **Step 2 :** Open `Virinas-code/Crocrodile` in package search bar and press *<Enter>*

### Error message

> Python 3.7.3 [default, GCC 8.3.0]
> Linux-4.19.0-16-amd64-x86_64-with-glibc2.28
> Module Index : Topics : Keywords
 
 
> Error	 
> Virinas-code/Crocrodile.html
> There was an error while retrieving documentation for the object you requested: Object could not be found


### Traceback
```python-traceback
  File "/usr/lib/python3.7/socketserver.py", line 316, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.7/socketserver.py", line 347, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.7/socketserver.py", line 720, in __init__
    self.handle()
  File "/usr/lib/python3.7/http/server.py", line 426, in handle
    self.handle_one_request()
  File "/usr/lib/python3.7/http/server.py", line 414, in handle_one_request
    method()
  File "/usr/local/lib/python3.7/dist-packages/spyder/plugins/onlinehelp/pydoc_patch.py", line 911, in do_GET
    self.path, content_type).encode('utf-8'))
  File "/usr/local/lib/python3.7/dist-packages/spyder/plugins/onlinehelp/pydoc_patch.py", line 867, in _url_handler
    with open(css_path) as fp:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.7/dist-packages/spyder/plugins/onlinehelp/Virinas-code/static/css/dark_pydoc.css'
----------------------------------------
```

## Versions

* Spyder version: 4.2.5 
* Python version: 3.7.3
* Qt version: 5.12.10
* PyQt5 version: 5.12.3
* Operating System: Linux 4.19.0-16-amd64

### Dependencies

```

# Mandatory:
atomicwrites >=1.2.0            :  1.4.0 (OK)
chardet >=2.0.0                 :  4.0.0 (OK)
cloudpickle >=0.5.0             :  1.6.0 (OK)
diff_match_patch >=20181111     :  20200713 (OK)
intervaltree >=3.0.2            :  3.1.0 (OK)
IPython >=7.6.0                 :  7.22.0 (OK)
jedi =0.17.2                    :  0.17.2 (OK)
jsonschema >=3.2.0              :  3.2.0 (OK)
keyring >=17.0.0                :  17.1.1 (OK)
nbconvert >=4.0                 :  None (NOK)
numpydoc >=0.6.0                :  1.1.0 (OK)
parso =0.7.0                    :  0.7.0 (OK)
pexpect >=4.4.0                 :  4.6.0 (OK)
pickleshare >=0.4               :  0.7.5 (OK)
psutil >=5.3                    :  5.8.0 (OK)
pygments >=2.0                  :  2.8.1 (OK)
pylint >=1.0                    :  2.7.4 (OK)
pyls >=0.36.2;<1.0.0            :  0.36.2 (OK)
pyls_black >=0.4.6              :  0.4.6 (OK)
pyls_spyder >=0.3.2             :  0.3.2 (OK)
qdarkstyle >=2.8;<3.0           :  2.8.1 (OK)
qtawesome >=0.5.7               :  1.0.2 (OK)
qtconsole >=5.0.3               :  5.0.3 (OK)
qtpy >=1.5.0                    :  1.9.0 (OK)
setuptools >=39.0.0             :  56.0.0 (OK)
sphinx >=0.6.6                  :  3.5.4 (OK)
spyder_kernels >=1.10.2;<1.11.0 :  1.10.3 (OK)
textdistance >=4.2.0            :  4.2.1 (OK)
three_merge >=0.1.1             :  0.1.1 (OK)
watchdog >=0.10.3;<2.0.0        :  1.0.2 (OK)
xdg >=0.26                      :  0.27 (OK)
zmq >=17                        :  17.1.2 (OK)

# Optional:
cython >=0.21                   :  None (NOK)
matplotlib >=2.0.0              :  3.4.1 (OK)
numpy >=1.7                     :  1.20.2 (OK)
pandas >=1.1.1                  :  None (NOK)
scipy >=0.17.0                  :  None (NOK)
sympy >=0.7.3                   :  None (NOK)

# Spyder plugins:
spyder_terminal                 :  0.5.0 (OK)
```



Discussion:
Hey @Virinas-code, thanks for reporting. Did you add `Virinas-code/Crocrodile` to your `PYTHONPATH` or `sys.path` manually?
> Hey @Virinas-code, thanks for reporting. Did you add `Virinas-code/Crocrodile` to your `PYTHONPATH` or `sys.path` manually?

No, I don't.
Then I don't understand how this error can appear. If you're able to reproduce it with a simple example, please let us know. Otherwise, it's not to possible for us to understand how to solve it,
I recently updated Spyder and now I've got Spyder 5. I can reproduce the bug on.
Do you want the complete traceback ?
I've got an idea :
https://github.com/spyder-ide/spyder/blob/master/spyder/plugins/onlinehelp/pydoc_patch.py#L642

                '<link rel="stylesheet" type="text/css" href="%s">' %

replace `%s` by `/%s`
I can't test it because i've got dependencies problems when building. Can you test it for me ?

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
@@ -639,7 +639,7 @@ def page(self, title, contents):
                 css_path = "static/css/light_pydoc.css"
 
             css_link = (
-                '<link rel="stylesheet" type="text/css" href="%s">' %
+                '<link rel="stylesheet" type="text/css" href="/%s">' %
                 css_path)
 
             code_style = (


Test patch: