AttributeError: 'NoneType' object has no attribute 'children'

Arfrever Frehtes Taifersar Arahesis avatarArfrever Frehtes Taifersar Arahesis created an issue

This bug occurs with Sphinx hg tip (and e.g. 1.2b1 from PyPI). This bug does not occur with Sphinx 1.1.3.

$ cd /tmp
$ wget http://files.randombit.net/botan/v1.10/Botan-1.10.5.tbz
...
$ tar -xjf Botan-1.10.5.tbz
$ hg clone https://bitbucket.org/birkenfeld/sphinx
$ cd Botan-1.10.5
$ sed -e "/^check_sphinx_version()$/d" -i doc/conf.py
$ python2.7 /tmp/sphinx/sphinx-build.py doc html
Running Sphinx v1.2b1
loading pickled environment... not yet created
No builder selected, using default: html
building [html]: targets for 28 source files that are out of date
updating environment: 28 added, 0 changed, 0 removed
reading sources... [100%] x509                                                                                                                               
/tmp/Botan-1.10.5/doc/log.txt:86: ERROR: Unexpected indentation.
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [  3%] algos                                                                                                                               
Exception occurred:
  File "/tmp/sphinx/sphinx/environment.py", line 1046, in get_toctree_for
    result.extend(toctree.children)
AttributeError: 'NoneType' object has no attribute 'children'
The full traceback has been saved in /tmp/sphinx-err-snoVAJ.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.
Either send bugs to the mailing list at <http://groups.google.com/group/sphinx-users/>,
or report them in the tracker at <http://bitbucket.org/birkenfeld/sphinx/issues/>. Thanks!
$ cat /tmp/sphinx-err-snoVAJ.log
# Sphinx version: 1.2b1
# Python version: 2.7.4+
# Docutils version: 0.10 release
# Jinja2 version: 2.6
Traceback (most recent call last):
  File "/tmp/sphinx/sphinx/cmdline.py", line 247, in main
    app.build(force_all, filenames)
  File "/tmp/sphinx/sphinx/application.py", line 211, in build
    self.builder.build_update()
  File "/tmp/sphinx/sphinx/builders/__init__.py", line 211, in build_update
    'out of date' % len(to_build))
  File "/tmp/sphinx/sphinx/builders/__init__.py", line 267, in build
    self.write(docnames, list(updated_docnames), method)
  File "/tmp/sphinx/sphinx/builders/__init__.py", line 310, in write
    self._write_serial(sorted(docnames), warnings)
  File "/tmp/sphinx/sphinx/builders/__init__.py", line 323, in _write_serial
    self.write_doc(docname, doctree)
  File "/tmp/sphinx/sphinx/builders/html.py", line 438, in write_doc
    self.handle_page(docname, ctx, event_arg=doctree)
  File "/tmp/sphinx/sphinx/builders/html.py", line 750, in handle_page
    output = self.templates.render(templatename, ctx)
  File "/tmp/sphinx/sphinx/jinja2glue.py", line 128, in render
    return self.environment.get_template(template).render(context)
  File "/usr/lib64/python2.7/site-packages/jinja2/environment.py", line 898, in render
    return self.environment.handle_exception(exc_info, True)
  File "/tmp/sphinx/sphinx/themes/basic/page.html", line 10, in top-level template code
    {%- extends "layout.html" %}
  File "/tmp/Botan-1.10.5/doc/_templates/layout.html", line 1, in top-level template code
    {% extends "!layout.html" %}
  File "/tmp/sphinx/sphinx/themes/agogo/layout.html", line 11, in top-level template code
    {%- extends "basic/layout.html" %}
  File "/tmp/sphinx/sphinx/themes/basic/layout.html", line 160, in top-level template code
    {%- block content %}
  File "/tmp/sphinx/sphinx/themes/agogo/layout.html", line 45, in block "content"
    {%- block sidebartoc %}
  File "/tmp/sphinx/sphinx/themes/agogo/layout.html", line 47, in block "sidebartoc"
    {{ toctree() }}
  File "/usr/lib64/python2.7/site-packages/jinja2/sandbox.py", line 349, in call
    return __context.call(__obj, *args, **kwargs)
  File "/tmp/sphinx/sphinx/builders/html.py", line 742, in <lambda>
    ctx['toctree'] = lambda **kw: self._get_local_toctree(pagename, **kw)
  File "/tmp/sphinx/sphinx/builders/html.py", line 678, in _get_local_toctree
    docname, self, collapse, **kwds))['fragment']
  File "/tmp/sphinx/sphinx/environment.py", line 1046, in get_toctree_for
    result.extend(toctree.children)
AttributeError: 'NoneType' object has no attribute 'children'
$

Comments (2)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.