Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stylesheet: error in Sphinx 1.6 #3754

Closed
pcav opened this issue May 16, 2017 · 9 comments
Closed

Stylesheet: error in Sphinx 1.6 #3754

pcav opened this issue May 16, 2017 · 9 comments

Comments

@pcav
Copy link

pcav commented May 16, 2017

Just upgraded, I get a new error:
Exception occurred while building, starting debugger:

Traceback (most recent call last):
  File
"/usr/local/src/py3_virtual/lib/python3.5/site-packages/sphinx/cmdline.py",
line 306, in main
    app.build(opts.force_all, filenames)
  File
"/usr/local/src/py3_virtual/lib/python3.5/site-packages/sphinx/application.py",
line 338, in build
    self.builder.build_update()
  File
"/usr/local/src/py3_virtual/lib/python3.5/site-packages/sphinx/builders/__init__.py",
line 328, in build_update
    'out of date' % len(to_build))
  File
"/usr/local/src/py3_virtual/lib/python3.5/site-packages/sphinx/builders/__init__.py",
line 394, in build
    self.write(docnames, list(updated_docnames), method)
  File
"/usr/local/src/py3_virtual/lib/python3.5/site-packages/sphinx/builders/__init__.py",
line 431, in write
    self._write_serial(sorted(docnames))
  File
"/usr/local/src/py3_virtual/lib/python3.5/site-packages/sphinx/builders/__init__.py",
line 440, in _write_serial
    self.write_doc(docname, doctree)
  File
"/usr/local/src/py3_virtual/lib/python3.5/site-packages/sphinx/builders/html.py",
line 556, in write_doc
    self.handle_page(docname, ctx, event_arg=doctree)
  File
"/usr/local/src/py3_virtual/lib/python3.5/site-packages/sphinx/builders/html.py",
line 940, in handle_page
    output = self.templates.render(templatename, ctx)
  File
"/usr/local/src/py3_virtual/lib/python3.5/site-packages/sphinx/jinja2glue.py",
line 176, in render
    return self.environment.get_template(template).render(context)
  File
"/usr/local/src/py3_virtual/lib/python3.5/site-packages/jinja2/environment.py",
line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File
"/usr/local/src/py3_virtual/lib/python3.5/site-packages/jinja2/environment.py",
line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File
"/usr/local/src/py3_virtual/lib/python3.5/site-packages/jinja2/_compat.py",
line 37, in reraise
    raise value.with_traceback(tb)
  File
"/usr/local/src/py3_virtual/lib/python3.5/site-packages/sphinx/themes/basic/page.html",
line 10, in top-level template code
    {%- extends "layout.html" %}
  File "/usr/local/src/pcav/faunalia-website/_templates/layout.html",
line 39, in top-level template code
    {% block languageswitch %}
  File
"/usr/local/src/py3_virtual/lib/python3.5/site-packages/sphinx_bootstrap_theme/bootstrap/layout.html",
line 40, in top-level template code
    {% set css_files = css_files + theme_css_files +
bootswatch_css_custom %}
TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'
>
/usr/local/src/py3_virtual/lib/python3.5/site-packages/sphinx_bootstrap_theme/bootstrap/layout.html(40)top-level
template code()
-> {% set css_files = css_files + theme_css_files + bootswatch_css_custom %}
@staffan-einarsson
Copy link

I'm getting something very similar when building HTML.

New python executable in /[...]/.venv-build-docs/bin/python2.7
Also creating executable in /[...]/.venv-build-docs/bin/python
Installing setuptools, pip, wheel...done.
Collecting sphinx
  Downloading Sphinx-1.6.1-py2.py3-none-any.whl (1.9MB)
    100% |████████████████████████████████| 1.9MB 592kB/s 
Collecting sphinx-rtd-theme
  Using cached sphinx_rtd_theme-0.2.4-py2.py3-none-any.whl
Collecting imagesize (from sphinx)
  Using cached imagesize-0.7.1-py2.py3-none-any.whl
Requirement already up-to-date: six>=1.5 in ./.venv-build-docs/lib/python2.7/site-packages (from sphinx)
Collecting Pygments>=2.0 (from sphinx)
  Using cached Pygments-2.2.0-py2.py3-none-any.whl
Collecting sphinxcontrib-websupport (from sphinx)
  Downloading sphinxcontrib_websupport-1.0.1-py2.py3-none-any.whl
Collecting alabaster<0.8,>=0.7 (from sphinx)
  Using cached alabaster-0.7.10-py2.py3-none-any.whl
Collecting snowballstemmer>=1.1 (from sphinx)
  Using cached snowballstemmer-1.2.1-py2.py3-none-any.whl
Collecting docutils>=0.11 (from sphinx)
  Using cached docutils-0.13.1-py2-none-any.whl
Collecting typing (from sphinx)
  Downloading typing-3.6.1.tar.gz (66kB)
    100% |████████████████████████████████| 71kB 5.5MB/s 
Collecting babel!=2.0,>=1.3 (from sphinx)
  Using cached Babel-2.4.0-py2.py3-none-any.whl
Collecting requests>=2.0.0 (from sphinx)
  Downloading requests-2.14.2-py2.py3-none-any.whl (560kB)
    100% |████████████████████████████████| 563kB 1.8MB/s 
Requirement already up-to-date: setuptools in ./.venv-build-docs/lib/python2.7/site-packages (from sphinx)
Collecting Jinja2>=2.3 (from sphinx)
  Using cached Jinja2-2.9.6-py2.py3-none-any.whl
Collecting pytz>=0a (from babel!=2.0,>=1.3->sphinx)
  Using cached pytz-2017.2-py2.py3-none-any.whl
Requirement already up-to-date: packaging>=16.8 in ./.venv-build-docs/lib/python2.7/site-packages (from setuptools->sphinx)
Requirement already up-to-date: appdirs>=1.4.0 in ./.venv-build-docs/lib/python2.7/site-packages (from setuptools->sphinx)
Collecting MarkupSafe>=0.23 (from Jinja2>=2.3->sphinx)
Requirement already up-to-date: pyparsing in ./.venv-build-docs/lib/python2.7/site-packages (from packaging>=16.8->setuptools->sphinx)
Building wheels for collected packages: typing
  Running setup.py bdist_wheel for typing ... done
  Stored in directory: /Users/staffan.einarsson/Library/Caches/pip/wheels/b3/54/d1/d7ad0895b6f57c608afdf3ec5d2339c5d18ffcf2c2e0e0d9aa
Successfully built typing
Installing collected packages: imagesize, Pygments, sphinxcontrib-websupport, alabaster, snowballstemmer, docutils, typing, pytz, babel, requests, MarkupSafe, Jinja2, sphinx, sphinx-rtd-theme
Successfully installed Jinja2-2.9.6 MarkupSafe-1.0 Pygments-2.2.0 alabaster-0.7.10 babel-2.4.0 docutils-0.13.1 imagesize-0.7.1 pytz-2017.2 requests-2.14.2 snowballstemmer-1.2.1 sphinx-1.6.1 sphinx-rtd-theme-0.2.4 sphinxcontrib-websupport-1.0.1 typing-3.6.1
rm -rf build/*
sphinx-build -b html -d build/doctrees   src build/html
Running Sphinx v1.6.1
making output directory...
loading pickled environment... not yet created
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 49 source files that are out of date
updating environment: 49 added, 0 changed, 0 removed
reading sources... [100%] rnotes                                                                                                                                                                            

[...]

looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [  2%] api/apidoc                                                                                                                                                                         
Exception occurred:
  File "/[...]/.venv-build-docs/lib/python2.7/site-packages/sphinx_rtd_theme/layout.html", line 45, in top-level template code
    {% for cssfile in css_files %}
TypeError: 'NoneType' object is not iterable
The full traceback has been saved in /var/folders/p3/5jj6nq1j34lfk_q3882rbppr0000gn/T/sphinx-err-ZNs48p.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make: *** [html] Error 1
# Sphinx version: 1.6.1
# Python version: 2.7.13 (CPython)
# Docutils version: 0.13.1 release
# Jinja2 version: 2.9.6
# Last messages:
#   
#   looking for now-outdated files...
#   none found
#   pickling environment...
#   done
#   checking consistency...
#   done
#   preparing documents...
#   done
#   writing output... [  2%] api/apidoc
# Loaded extensions:
#   sphinx.ext.autodoc (1.6.1) from /[...]/.venv-build-docs/lib/python2.7/site-packages/sphinx/ext/autodoc.pyc
#   alabaster (0.7.10) from /[...]/.venv-build-docs/lib/python2.7/site-packages/alabaster/__init__.pyc
#   sphinx.ext.githubpages (1.6.1) from /[...]/.venv-build-docs/lib/python2.7/site-packages/sphinx/ext/githubpages.pyc
Traceback (most recent call last):
  File "/[...]/.venv-build-docs/lib/python2.7/site-packages/sphinx/cmdline.py", line 306, in main
    app.build(opts.force_all, filenames)
  File "/[...]/.venv-build-docs/lib/python2.7/site-packages/sphinx/application.py", line 338, in build
    self.builder.build_update()
  File "/[...]/.venv-build-docs/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 328, in build_update
    'out of date' % len(to_build))
  File "/[...]/.venv-build-docs/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 394, in build
    self.write(docnames, list(updated_docnames), method)
  File "/[...]/.venv-build-docs/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 431, in write
    self._write_serial(sorted(docnames))
  File "/[...]/.venv-build-docs/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 440, in _write_serial
    self.write_doc(docname, doctree)
  File "/[...]/.venv-build-docs/lib/python2.7/site-packages/sphinx/builders/html.py", line 556, in write_doc
    self.handle_page(docname, ctx, event_arg=doctree)
  File "/[...]/.venv-build-docs/lib/python2.7/site-packages/sphinx/builders/html.py", line 940, in handle_page
    output = self.templates.render(templatename, ctx)
  File "/[...]/.venv-build-docs/lib/python2.7/site-packages/sphinx/jinja2glue.py", line 176, in render
    return self.environment.get_template(template).render(context)
  File "/[...]/.venv-build-docs/lib/python2.7/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/[...]/.venv-build-docs/lib/python2.7/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/[...]/.venv-build-docs/lib/python2.7/site-packages/sphinx/themes/basic/page.html", line 10, in top-level template code
    {%- extends "layout.html" %}
  File "/[...]/doc/src/_templates/layout.html", line 2, in top-level template code
    {% set css_files = css_files + ["_static/myStyle.css"] %}
  File "/[...]/.venv-build-docs/lib/python2.7/site-packages/sphinx_rtd_theme/layout.html", line 45, in top-level template code
    {% for cssfile in css_files %}
TypeError: 'NoneType' object is not iterable

@ulsa
Copy link

ulsa commented May 17, 2017

I have a similar problem:

# Sphinx version: 1.6.1
# Python version: 2.7.13 (CPython)
# Docutils version: 0.13.1 release
# Jinja2 version: 2.9.6
...
  File ".../lib/python2.7/site-packages/sphinx/themes/basic/../basic/layout.html", line 108, in template
    {%- for css in css_files %}
TypeError: 'NoneType' object is not iterable

Is the problem that nothing sets css_files?

@tk0miya
Copy link
Member

tk0miya commented May 17, 2017

Fixed at 62614af. Could you check this please if possible?

@ulsa
Copy link

ulsa commented May 17, 2017

One workaround is to install sphinx==1.5.6.

@zapme
Copy link

zapme commented May 17, 2017

Checked, works for me.

@pcav
Copy link
Author

pcav commented May 17, 2017

Confirmed. Thanks.

@theacodes
Copy link

Any idea when this will be released? It's currently breaking the build for packaging.python.org. (I'm going to pin to 1.5.6 in the meantime)

theacodes pushed a commit to theacodes/python-packaging-user-guide that referenced this issue May 20, 2017
theacodes pushed a commit to pypa/packaging.python.org that referenced this issue May 20, 2017
@tk0miya
Copy link
Member

tk0miya commented May 22, 2017

I'm very sorry. Now I don't have enough time for new release.
It might be at this weekend.

0xHiteshPatel added a commit to f5devcentral/f5-automation-labs that referenced this issue May 23, 2017
0xHiteshPatel added a commit to f5devcentral/f5-automation-labs that referenced this issue May 23, 2017
openstack-gerrit pushed a commit to openstack-archive/nova-zvm-virt-driver that referenced this issue May 24, 2017
per sphinx-doc/sphinx#3754

Change-Id: If0fd528140b80aba21567aa72d84d22a93aff7d8
andrewdhicks added a commit to opendatacube/datacube-core that referenced this issue May 24, 2017
andrewdhicks added a commit to opendatacube/datacube-core that referenced this issue May 24, 2017
@theacodes
Copy link

@tk0miya no worries, just wanted a general idea. :)

openstack-gerrit pushed a commit to openstack/openstack that referenced this issue Jun 7, 2017
Project: openstack/nova-specs  f49397be06404d310483f49b2c062c8b3dd70767

Uncap sphinx version

Sphinx version has been capped since
I9c45d239e156ec4fb49b5d8bd2404b66155be92b
in order to fix an issue with resolving citations.

Then, in I7e55dcf910e0ba6dd85b565db8cb1ecbdd39634a,
the issue has been fixed by modifying citation references.

So uncap sphinx version.
But sphinx 1.6.1 has another issue (*1),
so leave sphinx 1.6.1 in the blacklist.

*1: sphinx-doc/sphinx#3754

Change-Id: I09acc562bc37edc3c8a40027f7eb359aaa956c32
Related-Bug: #1695127
openstack-gerrit pushed a commit to openstack/nova-specs that referenced this issue Jun 7, 2017
Sphinx version has been capped since
I9c45d239e156ec4fb49b5d8bd2404b66155be92b
in order to fix an issue with resolving citations.

Then, in I7e55dcf910e0ba6dd85b565db8cb1ecbdd39634a,
the issue has been fixed by modifying citation references.

So uncap sphinx version.
But sphinx 1.6.1 has another issue (*1),
so leave sphinx 1.6.1 in the blacklist.

*1: sphinx-doc/sphinx#3754

Change-Id: I09acc562bc37edc3c8a40027f7eb359aaa956c32
Related-Bug: #1695127
ncoghlan pushed a commit to ncoghlan/packaging.python.org that referenced this issue Jun 24, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants