Readthedocs添加html_logo导致类型错误



我在readthedocs.io上部署了一些文档。在我向conf.py中添加以下行之前,它一直工作正常:

html_logo = '_static/logo.png',

一旦我尝试在readthedocs上构建项目,它就会失败,并出现以下错误:

Running Sphinx v4.2.0
loading translations [en]... done
making output directory... done
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/project/envs/latest/lib/python3.7/site-packages/sphinx/events.py", line 101, in emit
results.append(listener.handler(self.app, *args))
File "/home/docs/checkouts/readthedocs.org/user_builds/project/envs/latest/lib/python3.7/site-packages/sphinx/builders/html/__init__.py", line 1260, in validate_html_logo
not path.isfile(path.join(app.confdir, config.html_logo)) and
File "/home/docs/checkouts/readthedocs.org/user_builds/project/envs/latest/lib/python3.7/posixpath.py", line 94, in join
genericpath._check_arg_types('join', a, *p)
File "/home/docs/checkouts/readthedocs.org/user_builds/project/envs/latest/lib/python3.7/genericpath.py", line 153, in _check_arg_types
(funcname, s.__class__.__name__)) from None
TypeError: join() argument must be str or bytes, not 'tuple'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/project/envs/latest/lib/python3.7/site-packages/sphinx/cmd/build.py", line 279, in build_main
args.tags, args.verbosity, args.jobs, args.keep_going)
File "/home/docs/checkouts/readthedocs.org/user_builds/project/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 261, in __init__
self.events.emit('config-inited', self.config)
File "/home/docs/checkouts/readthedocs.org/user_builds/project/envs/latest/lib/python3.7/site-packages/sphinx/events.py", line 110, in emit
(listener.handler, name), exc, modname=modname) from exc
sphinx.errors.ExtensionError: Handler <function validate_html_logo at 0x7f421c4a53b0> for event 'config-inited' threw an exception (exception: join() argument must be str or bytes, not 'tuple')
Extension error (sphinx.builders.html):
Handler <function validate_html_logo at 0x7f421c4a53b0> for event 'config-inited' threw an exception (exception: join() argument must be str or bytes, not 'tuple')

目录结构如下:

project/
├─ docs/
│  ├─ _static/
│  │  ├─ logo.png
│  ├─ conf.py
│  ├─ index.rst

将值从元组更改为字符串

元组,以逗号

结尾
html_logo = '_static/logo.png',

只是一个字符串

html_logo = '_static/logo.png'

相关内容

  • 没有找到相关文章

最新更新