# Buggy code
def setup(app):
    # type: (Sphinx) -> Dict[unicode, Any]
    """Sphinx extension setup function.

    When the extension is loaded, Sphinx imports this module and executes
    the ``setup()`` function, which in turn notifies Sphinx of everything
    the extension offers.

    Parameters
    ----------
    app : sphinx.application.Sphinx
        Application object representing the Sphinx process

    See Also
    --------
    `The Sphinx documentation on Extensions
    <http://sphinx-doc.org/extensions.html>`_

    `The Extension Tutorial <http://sphinx-doc.org/extdev/tutorial.html>`_

    `The Extension API <http://sphinx-doc.org/extdev/appapi.html>`_

    """
    if not isinstance(app, Sphinx):
        return  # probably called by tests

    _patch_python_domain()

    app.setup_extension("sphinx.ext.autodoc")
    app.connect("autodoc-process-docstring", _process_docstring)
    app.connect("autodoc-skip-member", _skip_member)

    for name, (default, rebuild) in Config._config_values.items():
        app.add_config_value(name, default, rebuild)
    return {"version": sphinx.__display_version__, "parallel_read_safe": True}


# Traceback (TypeError)
# Sphinx version: 1.8.0
# Python version: 3.7.0 (CPython)
# Docutils version: 0.14
# Jinja2 version: 2.10
# Last messages:
#   writing output... [ 59%] someclass
#
# Loaded extensions:
#   sphinx.ext.mathjax (1.8.0) from /.venv/lib/python3.7/site-packages/sphinx/ext/mathjax.py
#   alabaster (0.7.11) from /.venv/lib/python3.7/site-packages/alabaster/__init__.py
#   sphinx.ext.autodoc (1.8.0) from /.venv/lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py
#   sphinx.ext.napoleon (1.8.0) from /.venv/lib/python3.7/site-packages/sphinx/ext/napoleon/__init__.py
Traceback (most recent call last):
File "/.venv/lib/python3.7/site-packages/sphinx/cmd/build.py", line 304, in build_main
app.build(args.force_all, filenames)
File "/.venv/lib/python3.7/site-packages/sphinx/application.py", line 341, in build
self.builder.build_update()
File "/.venv/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 347, in build_update
len(to_build))
File "/.venv/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 412, in build
self.write(docnames, list(updated_docnames), method)
File "/.venv/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 593, in write
self._write_serial(sorted(docnames))
File "/.venv/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 604, in _write_serial
self.write_doc(docname, doctree)
File "/.venv/lib/python3.7/site-packages/sphinx/builders/html.py", line 730, in write_doc
self.docwriter.write(doctree, destination)
File "/.venv/lib/python3.7/site-packages/docutils/writers/__init__.py", line 80, in write
self.translate()
File "/.venv/lib/python3.7/site-packages/sphinx/writers/html.py", line 58, in translate
self.document.walkabout(visitor)
File "/.venv/lib/python3.7/site-packages/docutils/nodes.py", line 174, in walkabout
if child.walkabout(visitor):
File "/.venv/lib/python3.7/site-packages/docutils/nodes.py", line 174, in walkabout
if child.walkabout(visitor):
File "/.venv/lib/python3.7/site-packages/docutils/nodes.py", line 174, in walkabout
if child.walkabout(visitor):
[Previous line repeated 4 more times]
File "/.venv/lib/python3.7/site-packages/docutils/nodes.py", line 166, in walkabout
visitor.dispatch_visit(self)
File "/.venv/lib/python3.7/site-packages/docutils/nodes.py", line 1882, in dispatch_visit
return method(node)
File "/.venv/lib/python3.7/site-packages/docutils/writers/html4css1/__init__.py", line 402, in visit_field_body
self.set_class_on_child(node, 'first', 0)
File "/.venv/lib/python3.7/site-packages/docutils/writers/_html_base.py", line 399, in set_class_on_child
child['classes'].append(class_)
TypeError: string indices must be integers

# Fixed code
def setup(app):
    # type: (Sphinx) -> Dict[unicode, Any]
    """Sphinx extension setup function.

    When the extension is loaded, Sphinx imports this module and executes
    the ``setup()`` function, which in turn notifies Sphinx of everything
    the extension offers.

    Parameters
    ----------
    app : sphinx.application.Sphinx
        Application object representing the Sphinx process

    See Also
    --------
    `The Sphinx documentation on Extensions
    <http://sphinx-doc.org/extensions.html>`_

    `The Extension Tutorial <http://sphinx-doc.org/extdev/tutorial.html>`_

    `The Extension API <http://sphinx-doc.org/extdev/appapi.html>`_

    """
    if not isinstance(app, Sphinx):
        # probably called by tests
        return {"version": __version__, "parallel_read_safe": True}

    _patch_python_domain()

    app.setup_extension("sphinx.ext.autodoc")
    app.connect("autodoc-process-docstring", _process_docstring)
    app.connect("autodoc-skip-member", _skip_member)

    for name, (default, rebuild) in Config._config_values.items():
        app.add_config_value(name, default, rebuild)
    return {"version": __version__, "parallel_read_safe": True}