# Buggy code
def __init__(self, *args):
    # type: (Any) -> None
    if isinstance(args[0], nodes.document) and isinstance(args[1], Builder):
        document, builder = args
    else:
        warnings.warn(
            "The order of arguments for HTML5Translator has been changed. "
            'Please give "document" as 1st and "builder" as 2nd.',
            RemovedInSphinx40Warning,
            stacklevel=2,
        )
        builder, document = args
    super().__init__(document, builder)

    self.highlighter = self.builder.highlighter
    self.docnames = [self.builder.current_docname]  # for singlehtml builder
    self.manpages_url = self.config.manpages_url
    self.protect_literal_text = 0
    self.permalink_text = self.config.html_add_permalinks
    # support backwards-compatible setting to a bool
    if not isinstance(self.permalink_text, str):
        self.permalink_text = self.permalink_text and "¶" or ""
    self.permalink_text = self.encode(self.permalink_text)
    self.secnumber_suffix = self.config.html_secnumber_suffix
    self.param_separator = ""
    self.optional_param_level = 0
    self._table_row_index = 0
    self.required_params_left = 0


# Traceback (AttributeError)
# Sphinx version: 2.0.0
# Python version: 3.7.3 (CPython)
# Docutils version: 0.14
# Jinja2 version: 2.10
# Last messages:
#   none found
#   pickling environment...
#   done
#   checking consistency...
#   done
#   preparing documents...
#   done
#   writing output... [ 14%] ***
#   writing output... [ 28%] ***
#   writing output... [ 42%] ***
# Loaded extensions:
#   sphinx.ext.mathjax (2.0.0) from c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\sphinx\ext\mathjax.py
#   sphinxcontrib.applehelp (1.0.1) from c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\sphinxcontrib\applehelp\__init__.py
#   sphinxcontrib.devhelp (1.0.1) from c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\sphinxcontrib\devhelp\__init__.py
#   sphinxcontrib.htmlhelp (1.0.1) from c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\sphinxcontrib\htmlhelp\__init__.py
#   sphinxcontrib.serializinghtml (1.1.3) from c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\sphinxcontrib\serializinghtml\__init__.py
#   sphinxcontrib.qthelp (1.0.2) from c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\sphinxcontrib\qthelp\__init__.py
#   alabaster (0.7.12) from c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\alabaster\__init__.py
#   myext.myextension(unknown version) from D:\Python\docs\source\_ext\myext\myextension.py
Traceback (most recent call last):
File "c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\sphinx\cmd\build.py", line 284, in build_main
app.build(args.force_all, filenames)
File "c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\sphinx\application.py", line 338, in build
self.builder.build_update()
File "c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\sphinx\builders\__init__.py", line 326, in build_update
len(to_build))
File "c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\sphinx\builders\__init__.py", line 389, in build
self.write(docnames, list(updated_docnames), method)
File "c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\sphinx\builders\__init__.py", line 569, in write
self._write_serial(sorted(docnames))
File "c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\sphinx\builders\__init__.py", line 580, in _write_serial
self.write_doc(docname, doctree)
File "c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\sphinx\builders\html.py", line 646, in write_doc
self.docwriter.write(doctree, destination)
File "c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\docutils\writers\__init__.py", line 80, in write
self.translate()
File "c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\sphinx\writers\html.py", line 59, in translate
self.document.walkabout(visitor)
File "c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\docutils\nodes.py", line 174, in walkabout
if child.walkabout(visitor):
File "c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\docutils\nodes.py", line 174, in walkabout
if child.walkabout(visitor):
File "c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\docutils\nodes.py", line 174, in walkabout
if child.walkabout(visitor):
File "c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\docutils\nodes.py", line 166, in walkabout
visitor.dispatch_visit(self)
File "c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\docutils\nodes.py", line 1882, in dispatch_visit
return method(node)
File "c:\users\madteddy\appdata\local\programs\python\python37-32\lib\site-packages\sphinx\writers\html5.py", line 850, in visit_field
self._fieldlist_row_index += 1
AttributeError: 'HTML5Translator' object has no attribute '_fieldlist_row_index'

# Fixed code
def __init__(self, *args):
    # type: (Any) -> None
    if isinstance(args[0], nodes.document) and isinstance(args[1], Builder):
        document, builder = args
    else:
        warnings.warn(
            "The order of arguments for HTML5Translator has been changed. "
            'Please give "document" as 1st and "builder" as 2nd.',
            RemovedInSphinx40Warning,
            stacklevel=2,
        )
        builder, document = args
    super().__init__(document, builder)

    self.highlighter = self.builder.highlighter
    self.docnames = [self.builder.current_docname]  # for singlehtml builder
    self.manpages_url = self.config.manpages_url
    self.protect_literal_text = 0
    self.permalink_text = self.config.html_add_permalinks
    # support backwards-compatible setting to a bool
    if not isinstance(self.permalink_text, str):
        self.permalink_text = self.permalink_text and "¶" or ""
    self.permalink_text = self.encode(self.permalink_text)
    self.secnumber_suffix = self.config.html_secnumber_suffix
    self.param_separator = ""
    self.optional_param_level = 0
    self._table_row_index = 0
    self._fieldlist_row_index = 0
    self.required_params_left = 0