﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21869	Documentation not building on Sphinx 1.2.1	James Turley	nobody	"The latest release of Sphinx throws an AttributeError during the documentation build process. AttributeError: DjangoHTMLTranslator instance has no attribute 'optional_param_level'

To reproduce the error, just try to build the docs with Sphinx 1.2.1, into any format that requires a DjangoHTMLTranslator instance in the build process, obviously. (HTML, EPUB and JSON fail; LaTeX does not.)

I raise it here as it is already on the [https://bitbucket.org/birkenfeld/sphinx/issue/1355/attributeerror-using-sphinx-121 sphinx tracker]: while resolved, the committer comments ""Thanks for the report. This is not really a Sphinx issue (Django has to adapt their extension) but I pushed a fix that should make it work until they do.""

I've tagged this as v1.6, but it also affects the master branch, where I ran into it in the first place.

pip freeze:
{{{
Django==1.6.1
Jinja2==2.7.2
MarkupSafe==0.18
Pygments==1.6
Sphinx==1.2.1
argparse==1.2.1
docutils==0.11
wsgiref==0.1.2
}}}

Terminal output on 'make html' (and other formats):


{{{
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [  4%] howto/auth-remote-user                                 
Exception occurred:
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/sphinx/writers/html.py"", line 153, in visit_desc_parameter
    if self.optional_param_level == 0:
AttributeError: DjangoHTMLTranslator instance has no attribute 'optional_param_level'
The full traceback has been saved in /tmp/sphinx-err-dGETXL.log, if you want to report the issue to the developers.

}}}


The trace in the logfile mentioned above:


{{{
Traceback (most recent call last):
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/sphinx/cmdline.py"", line 254, in main
    app.build(force_all, filenames)
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/sphinx/application.py"", line 212, in build
    self.builder.build_update()
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/sphinx/builders/__init__.py"", line 214, in build_update
    'out of date' % len(to_build))
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/sphinx/builders/__init__.py"", line 276, in build
    self.write(docnames, list(updated_docnames), method)
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/sphinx/builders/__init__.py"", line 320, in write
    self._write_serial(sorted(docnames), warnings)
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/sphinx/builders/__init__.py"", line 333, in _write_serial
    self.write_doc(docname, doctree)
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/sphinx/builders/html.py"", line 433, in write_doc
    self.docwriter.write(doctree, destination)
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/docutils/writers/__init__.py"", line 80, in write
    self.translate()
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/sphinx/writers/html.py"", line 51, in translate
    self.document.walkabout(visitor)
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/docutils/nodes.py"", line 174, in walkabout
    if child.walkabout(visitor):
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/docutils/nodes.py"", line 174, in walkabout
    if child.walkabout(visitor):
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/docutils/nodes.py"", line 174, in walkabout
    if child.walkabout(visitor):
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/docutils/nodes.py"", line 174, in walkabout
    if child.walkabout(visitor):
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/docutils/nodes.py"", line 174, in walkabout
    if child.walkabout(visitor):
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/docutils/nodes.py"", line 174, in walkabout
    if child.walkabout(visitor):
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/docutils/nodes.py"", line 174, in walkabout
    if child.walkabout(visitor):
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/docutils/nodes.py"", line 166, in walkabout
    visitor.dispatch_visit(self)
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/docutils/nodes.py"", line 1882, in dispatch_visit
    return method(node)
  File ""/home/filben/.virtualenvs/django-fixes/local/lib/python2.7/site-packages/sphinx/writers/html.py"", line 153, in visit_desc_parameter
    if self.optional_param_level == 0:
AttributeError: DjangoHTMLTranslator instance has no attribute 'optional_param_level'
}}}"	Bug	closed	Documentation	1.6	Normal	fixed			Accepted	0	0	0	0	0	0
