FileNotFoundError when autodocumenting highlightjs.py
Sphinx raises a bunch of those
WARNING: autodoc: failed to import module 'urls' from module 'swh.web'; the following exception was raised:
Traceback (most recent call last):
File "/home/dev/swh-environment/swh-docs/.tox/sphinx-dev/lib/python3.7/site-packages/sphinx/ext/autodoc/importer.py", line 71, in import_module
return importlib.import_module(modname)
File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/dev/swh-environment/swh-docs/.tox/sphinx-dev/lib/python3.7/site-packages/swh/web/urls.py", line 47, in <module>
url(r"^browse/", include("swh.web.browse.urls")),
File "/home/dev/swh-environment/swh-docs/.tox/sphinx-dev/lib/python3.7/site-packages/django/urls/conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/dev/swh-environment/swh-docs/.tox/sphinx-dev/lib/python3.7/site-packages/swh/web/browse/urls.py", line 11, in <module>
import swh.web.browse.views.content # noqa
File "/home/dev/swh-environment/swh-docs/.tox/sphinx-dev/lib/python3.7/site-packages/swh/web/browse/views/content.py", line 18, in <module>
from swh.web.browse.snapshot_context import get_snapshot_context
File "/home/dev/swh-environment/swh-docs/.tox/sphinx-dev/lib/python3.7/site-packages/swh/web/browse/snapshot_context.py", line 27, in <module>
from swh.web.browse.utils import (
File "/home/dev/swh-environment/swh-docs/.tox/sphinx-dev/lib/python3.7/site-packages/swh/web/browse/utils.py", line 18, in <module>
from swh.web.common import archive, highlightjs
File "/home/dev/swh-environment/swh-docs/.tox/sphinx-dev/lib/python3.7/site-packages/swh/web/common/highlightjs.py", line 15, in <module>
with open(str(find("json/highlightjs-languages.json")), "r") as _hljs_languages_file:
FileNotFoundError: [Errno 2] No such file or directory: 'None'
Migrated from T3248 (view on Phabricator)
Edited by Phabricator Migration user