# Buggy code
def __init__(self, document: nodes.document, builder: "TexinfoBuilder") -> None:
    super().__init__(document, builder)
    self.init_settings()

    self.written_ids = set()  # type: Set[str]
    # node names and anchors in output
    # node names and anchors that should be in output
    self.referenced_ids = set()  # type: Set[str]
    self.indices = []  # type: List[Tuple[str, str]]
    # (node name, content)
    self.short_ids = {}  # type: Dict[str, str]
    # anchors --> short ids
    self.node_names = {}  # type: Dict[str, str]
    # node name --> node's name to display
    self.node_menus = {}  # type: Dict[str, List[str]]
    # node name --> node's menu entries
    self.rellinks = {}  # type: Dict[str, List[str]]
    # node name --> (next, previous, up)

    self.collect_indices()
    self.collect_node_names()
    self.collect_node_menus()
    self.collect_rellinks()

    self.body = []  # type: List[str]
    self.context = []  # type: List[str]
    self.previous_section = None  # type: nodes.section
    self.section_level = 0
    self.seen_title = False
    self.next_section_ids = set()  # type: Set[str]
    self.escape_newlines = 0
    self.escape_hyphens = 0
    self.curfilestack = []  # type: List[str]
    self.footnotestack = []  # type: List[Dict[str, List[Union[collected_footnote, bool]]]]  # NOQA
    self.in_footnote = 0
    self.handled_abbrs = set()  # type: Set[str]
    self.colwidths = None  # type: List[int]


# Traceback (TypeError)
# Sphinx version: 3.1.2
# Python version: 3.8.3 (CPython)
# Docutils version: 0.16 release
# Jinja2 version: 2.11.1
# Last messages:
#   internals/authors
#   faq
#   glossary
#   changes
#   examples
#
#   resolving references...
#   done
#   writing...
#   failed
# Loaded extensions:
#   sphinx.ext.mathjax (3.1.2) from ~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/ext/mathjax.py
#   sphinxcontrib.applehelp (1.0.2) from ~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinxcontrib/applehelp/__init__.py
#   sphinxcontrib.devhelp (1.0.2) from ~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinxcontrib/devhelp/__init__.py
#   sphinxcontrib.htmlhelp (1.0.3) from ~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinxcontrib/htmlhelp/__init__.py
#   sphinxcontrib.serializinghtml (1.1.4) from ~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinxcontrib/serializinghtml/__init__.py
#   sphinxcontrib.qthelp (1.0.3) from ~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinxcontrib/qthelp/__init__.py
#   alabaster (0.7.12) from ~/.virtualenvs/python-3.8/lib/python3.8/site-packages/alabaster/__init__.py
#   sphinx.ext.autodoc.type_comment (3.1.2) from ~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/ext/autodoc/type_comment.py
#   sphinx.ext.autodoc (3.1.2) from ~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py
#   sphinx.ext.doctest (3.1.2) from ~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/ext/doctest.py
#   sphinx.ext.todo (3.1.2) from ~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/ext/todo.py
#   sphinx.ext.autosummary (3.1.2) from ~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/ext/autosummary/__init__.py
#   sphinx.ext.extlinks (3.1.2) from ~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/ext/extlinks.py
#   sphinx.ext.intersphinx (3.1.2) from ~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/ext/intersphinx.py
#   sphinx.ext.viewcode (3.1.2) from ~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/ext/viewcode.py
#   sphinx.ext.graphviz (3.1.2) from ~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/ext/graphviz.py
#   sphinx.ext.inheritance_diagram (3.1.2) from ~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/ext/inheritance_diagram.py
Traceback (most recent call last):
File "~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/cmd/build.py", line 280, in build_main
app.build(args.force_all, filenames)
File "~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/application.py", line 348, in build
self.builder.build_update()
File "~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 294, in build_update
self.build(['__all__'], to_build)
File "~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 361, in build
self.write(docnames, list(updated_docnames), method)
File "~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/builders/texinfo.py", line 127, in write
docwriter.write(doctree, destination)
File "~/.virtualenvs/python-3.8/lib/python3.8/site-packages/docutils/writers/__init__.py", line 78, in write
self.translate()
File "~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/writers/texinfo.py", line 140, in translate
self.document.walkabout(visitor)
File "~/.virtualenvs/python-3.8/lib/python3.8/site-packages/docutils/nodes.py", line 214, in walkabout
if child.walkabout(visitor):
File "~/.virtualenvs/python-3.8/lib/python3.8/site-packages/docutils/nodes.py", line 214, in walkabout
if child.walkabout(visitor):
File "~/.virtualenvs/python-3.8/lib/python3.8/site-packages/docutils/nodes.py", line 214, in walkabout
if child.walkabout(visitor):
[Previous line repeated 13 more times]
File "~/.virtualenvs/python-3.8/lib/python3.8/site-packages/docutils/nodes.py", line 206, in walkabout
visitor.dispatch_visit(self)
File "~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/util/docutils.py", line 468, in dispatch_visit
method(node)
File "~/.virtualenvs/python-3.8/lib/python3.8/site-packages/sphinx/writers/texinfo.py", line 1457, in visit_desc_annotation
if txt == self.desc['desctype'] or \
TypeError: 'NoneType' object is not subscriptable

# Fixed code
def __init__(self, document: nodes.document, builder: "TexinfoBuilder") -> None:
    super().__init__(document, builder)
    self.init_settings()

    self.written_ids = set()  # type: Set[str]
    # node names and anchors in output
    # node names and anchors that should be in output
    self.referenced_ids = set()  # type: Set[str]
    self.indices = []  # type: List[Tuple[str, str]]
    # (node name, content)
    self.short_ids = {}  # type: Dict[str, str]
    # anchors --> short ids
    self.node_names = {}  # type: Dict[str, str]
    # node name --> node's name to display
    self.node_menus = {}  # type: Dict[str, List[str]]
    # node name --> node's menu entries
    self.rellinks = {}  # type: Dict[str, List[str]]
    # node name --> (next, previous, up)

    self.collect_indices()
    self.collect_node_names()
    self.collect_node_menus()
    self.collect_rellinks()

    self.body = []  # type: List[str]
    self.context = []  # type: List[str]
    self.descs = []  # type: List[addnodes.desc]
    self.previous_section = None  # type: nodes.section
    self.section_level = 0
    self.seen_title = False
    self.next_section_ids = set()  # type: Set[str]
    self.escape_newlines = 0
    self.escape_hyphens = 0
    self.curfilestack = []  # type: List[str]
    self.footnotestack = []  # type: List[Dict[str, List[Union[collected_footnote, bool]]]]  # NOQA
    self.in_footnote = 0
    self.handled_abbrs = set()  # type: Set[str]
    self.colwidths = None  # type: List[int]