# Buggy code
def apply(self, **kwargs):
    # type: (Any) -> None
    for node in self.document.traverse(addnodes.index):
        for entries in node["entries"]:
            if len(entries) == 4:
                source, line = get_source_line(node)
                warnings.warn(
                    "An old styled index node found: %r at (%s:%s)"
                    % (node, source, line),
                    RemovedInSphinx40Warning,
                )
                entries.extend([None])


# Traceback (AttributeError)
$ wget http://download.kde.org/stable/frameworks/5.56/extra-cmake-modules-5.56.0.tar.xz
$ tar -xf extra-cmake-modules-5.56.0.tar.xz
$ cd extra-cmake-modules-5.56.0/
$ python3.7 -m venv __venv__
$ . __venv__/bin/activate
(__venv__) $ pip install --pre sphinx
...
Successfully installed Jinja2-2.10 MarkupSafe-1.1.1 Pygments-2.3.1 alabaster-0.7.12 babel-2.6.0 certifi-2019.3.9 chardet-3.0.4 docutils-0.14 idna-2.8 imagesize-1.1.0 packaging-19.0 pyparsing-2.3.1 pytz-2018.9 requests-2.21.0 six-1.12.0 snowballstemmer-1.2.1 sphinx-2.0.0b1 sphinxcontrib-applehelp-1.0.1 sphinxcontrib-devhelp-1.0.1 sphinxcontrib-htmlhelp-1.0.1 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.2 sphinxcontrib-serializinghtml-1.1.1 urllib3-1.24.1
(__venv__) $ mkdir build
(__venv__) $ cd build/
(__venv__) $ cmake -DBUILD_HTML_DOCS:BOOL=ON -DSphinx_BUILD_EXECUTABLE:PATH=$(pwd)/../__venv__/bin/sphinx-build ..
-- Found Sphinx: /home/.../extra-cmake-modules-5.56.0/build/../__venv__/bin/sphinx-build (Required is at least version "1.2")
...
(__venv__) $ make
[ 50%] sphinx-build html: see /home/.../extra-cmake-modules/extra-cmake-modules-5.56.0/build/docs/build-html.log
/home/.../extra-cmake-modules-5.56.0/find-modules/FindCanberra.cmake:3: WARNING: Title underline too short.

FindCanberra
-------

Exception occurred:
File "/home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/sphinx/util/compat.py", line 66, in apply
entries.extend([None])
AttributeError: 'tuple' object has no attribute 'extend'
The full traceback has been saved in /tmp/sphinx-err-1dltdj4f.log, if you want to report the issue to the developers.
(__venv__) $ cat /tmp/sphinx-err-1dltdj4f.log
# Sphinx version: 2.0.0b1
# Python version: 3.7.2 (CPython)
# Docutils version: 0.14
# Jinja2 version: 2.10
# Last messages:
#   Running Sphinx v2.0.0b1
#   building [mo]: targets for 0 po files that are out of date
#   building [html]: targets for 59 source files that are out of date
#   updating environment:
#   59 added, 0 changed, 0 removed
#   reading sources... [  1%] find-module/FindCanberra
# Loaded extensions:
#   sphinx.ext.mathjax (2.0.0b1) from /home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/sphinx/ext/mathjax.py
#   sphinxcontrib.applehelp (1.0.1) from /home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/sphinxcontrib/applehelp/__init__.py
#   sphinxcontrib.devhelp (1.0.1) from /home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/sphinxcontrib/devhelp/__init__.py
#   sphinxcontrib.htmlhelp (1.0.1) from /home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/sphinxcontrib/htmlhelp/__init__.py
#   sphinxcontrib.serializinghtml (1.1.1) from /home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/sphinxcontrib/serializinghtml/__init__.py
#   sphinxcontrib.qthelp (1.0.2) from /home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/sphinxcontrib/qthelp/__init__.py
#   alabaster (0.7.12) from /home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/alabaster/__init__.py
#   ecm (unknown version) from /home/.../extra-cmake-modules-5.56.0/docs/sphinx/ext/ecm.py
Traceback (most recent call last):
File "/home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/sphinx/cmd/build.py", line 284, in build_main
app.build(args.force_all, filenames)
File "/home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/sphinx/application.py", line 338, in build
self.builder.build_update()
File "/home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/sphinx/builders/__init__.py", line 326, in build_update
len(to_build))
File "/home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/sphinx/builders/__init__.py", line 339, in build
updated_docnames = set(self.read())
File "/home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/sphinx/builders/__init__.py", line 445, in read
self._read_serial(docnames)
File "/home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/sphinx/builders/__init__.py", line 467, in _read_serial
self.read_doc(docname)
File "/home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/sphinx/builders/__init__.py", line 511, in read_doc
doctree = read_doc(self.app, self.env, self.env.doc2path(docname))
File "/home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/sphinx/io.py", line 324, in read_doc
pub.publish()
File "/home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/docutils/core.py", line 218, in publish
self.apply_transforms()
File "/home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/docutils/core.py", line 199, in apply_transforms
self.document.transformer.apply_transforms()
File "/home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/sphinx/transforms/__init__.py", line 90, in apply_transforms
super().apply_transforms()
File "/home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/docutils/transforms/__init__.py", line 171, in apply_transforms
transform.apply(**kwargs)
File "/home/.../extra-cmake-modules-5.56.0/__venv__/lib64/python3.7/site-packages/sphinx/util/compat.py", line 66, in apply
entries.extend([None])
AttributeError: 'tuple' object has no attribute 'extend'

# Fixed code
def apply(self, **kwargs):
    # type: (Any) -> None
    for node in self.document.traverse(addnodes.index):
        for i, entries in enumerate(node["entries"]):
            if len(entries) == 4:
                source, line = get_source_line(node)
                warnings.warn(
                    "An old styled index node found: %r at (%s:%s)"
                    % (node, source, line),
                    RemovedInSphinx40Warning,
                )
                node["entries"][i] = entries + (None,)