Sphinx: Sphinx 1.8.0b1 does not build with Bootstrap Theme

Created on 24 Aug 2018  路  9Comments  路  Source: sphinx-doc/sphinx

Subject:

Sphinx 1.8.0b1 does not build with the Bootstrap Theme

Problem

Maybe this is a Theme problem, but anyway using the bootstrap theme causes an error.

Procedure to reproduce the problem

Create a new sphinx project and use the bootstrap theme.

conf.py:

import sphinx_bootstrap_theme
html_theme = 'bootstrap'
html_theme_path = [sphinx_bootstrap_theme.get_html_theme_path()]

Error logs / results

# Sphinx version: 1.8.0b1
# Python version: 3.5.3 (CPython)
# Docutils version: 0.14 
# Jinja2 version: 2.10
# Last messages:

# Loaded extensions:
Traceback (most recent call last):
  File "/home/juh/sphinxbeta/lib/python3.5/site-packages/sphinx/cmd/build.py", line 303,   in build_main
    args.tags, args.verbosity, args.jobs, args.keep_going)
  File "/home/juh/sphinxbeta/lib/python3.5/site-packages/sphinx/application.py", line 263, in __init__
    self._init_builder()
  File "/home/juh/sphinxbeta/lib/python3.5/site-packages/sphinx/application.py", line 324, in _init_builder
    self.builder.init()
  File "/home/juh/sphinxbeta/lib/python3.5/site-packages/sphinx/builders/html.py", line    329, in init
    self.init_templates()
  File "/home/juh/sphinxbeta/lib/python3.5/site-packages/sphinx/builders/html.py", line    373, in init_templates
    theme_factory = HTMLThemeFactory(self.app)
  File "/home/juh/sphinxbeta/lib/python3.5/site-packages/sphinx/theming.py", line 173, in  __init__
    self.load_additional_themes(app.config.html_theme_path)
  File "/home/juh/sphinxbeta/lib/python3.5/site-packages/sphinx/theming.py", line 186, in  load_additional_themes
    abs_theme_path = path.abspath(path.join(self.app.confdir, theme_path))
  File "/usr/lib/python3.5/posixpath.py", line 89, in join
    genericpath._check_arg_types('join', a, *p)
  File "/usr/lib/python3.5/genericpath.py", line 143, in _check_arg_types
    (funcname, s.__class__.__name__)) from None
TypeError: join() argument must be str or bytes, not 'list'



Environment info

  • OS: Linux sokrates 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u3 (2018-08-19) x86_64 GNU/Linux

  • Python version: Python 3.5.3 (default, Jan 19 2017, 14:11:04)

  • Sphinx version: Sphinx v1.8.0b1

question

All 9 comments

This seems to be a Theme problem. Same error with Sphinx 1.7.6

Is this correct setting?

html_theme_path = [sphinx_bootstrap_theme.get_html_theme_path()]

It seems bootstrap theme expects it is not surround by bracket.
http://ryan-roemer.github.io/sphinx-bootstrap-theme/README.html#installation

This is a usage error, see sphinx-bootstram-theme/#165-comment ;)

We've provided an entry_point to configure HTML themes. I hope all themes uses this.
http://www.sphinx-doc.org/en/master/theming.html#distribute-your-theme-as-a-python-package

Hi @tk0miya,

Yes we are using that in setup.py and setup(app).

I don't think we realized the implication when that pull request was merged though. With some testing, I believe we can just remove that from the documentation / explain that setting html_theme_path in a conf.py is only necessary when using Sphinx < 1.6 (the setup(app) checks if app has that attribute before calling it).

Is this correct?

Sounds great! Yes, with Sphinx-1.6+, setup() function is called automatically if user chooses the theme via html_theme. So setting html_theme_path manually is not needed.
The procedure is only needed for old versions.

Most excellent, thanks for the confirmation! I'll fix up the docs :)

Yes. Without html_theme_path it works. :-)

I'm closing this now :-)

Was this page helpful?
0 / 5 - 0 ratings