# Buggy code
def execute(self, sql, parameters=()):
    """Same as :meth:`python:sqlite3.Connection.execute`."""
    if self.debug:
        tail = " with {!r}".format(parameters) if parameters else ""
        self.debug.write("Executing {!r}{}".format(sql, tail))
    try:
        return self.con.execute(sql, parameters)
    except sqlite3.Error as exc:
        msg = str(exc)
        try:
            # `execute` is the first thing we do with the database, so try
            # hard to provide useful hints if something goes wrong now.
            with open(self.filename, "rb") as bad_file:
                cov4_sig = b"!coverage.py: This is a private format"
                if bad_file.read(len(cov4_sig)) == cov4_sig:
                    msg = (
                        "Looks like a coverage 4.x data file. "
                        "Are you mixing versions of coverage?"
                    )
        except Exception:
            pass
        if self.debug:
            self.debug.write("EXCEPTION from execute: {}".format(msg))
        raise CoverageException(
            "Couldn't use data file {!r}: {}".format(self.filename, msg)
        )


# Traceback (_sqlite3.InterfaceError)
Traceback (most recent call last):
File "/home/runner/work/pytest/pytest/.tox/pypy3-coverage/bin/coverage", line 8, in <module>
sys.exit(main())
File "/home/runner/work/pytest/pytest/.tox/pypy3-coverage/site-packages/coverage/cmdline.py", line 865, in main
status = CoverageScript().command_line(argv)
File "/home/runner/work/pytest/pytest/.tox/pypy3-coverage/site-packages/coverage/cmdline.py", line 582, in command_line
return self.do_run(options, args)
File "/home/runner/work/pytest/pytest/.tox/pypy3-coverage/site-packages/coverage/cmdline.py", line 747, in do_run
self.coverage.save()
File "/home/runner/work/pytest/pytest/.tox/pypy3-coverage/site-packages/coverage/control.py", line 651, in save
data = self.get_data()
File "/home/runner/work/pytest/pytest/.tox/pypy3-coverage/site-packages/coverage/control.py", line 705, in get_data
if self._collector and self._collector.flush_data():
File "/home/runner/work/pytest/pytest/.tox/pypy3-coverage/site-packages/coverage/collector.py", line 423, in flush_data
self.covdata.add_arcs(self.mapped_file_dict(self.data))
File "/home/runner/work/pytest/pytest/.tox/pypy3-coverage/site-packages/coverage/sqldata.py", line 480, in add_arcs
data,
File "/home/runner/work/pytest/pytest/.tox/pypy3-coverage/site-packages/coverage/sqldata.py", line 1089, in executemany
return self.con.executemany(sql, data)
File "/opt/hostedtoolcache/PyPy/3.6.9/x64/lib_pypy/_sqlite3.py", line 423, in executemany
return cur.executemany(*args)
File "/opt/hostedtoolcache/PyPy/3.6.9/x64/lib_pypy/_sqlite3.py", line 773, in wrapper
return func(self, *args, **kwargs)
File "/opt/hostedtoolcache/PyPy/3.6.9/x64/lib_pypy/_sqlite3.py", line 938, in executemany
return self.__execute(True, sql, many_params)
File "/opt/hostedtoolcache/PyPy/3.6.9/x64/lib_pypy/_sqlite3.py", line 889, in __execute
self.__statement._set_params(params)
File "/opt/hostedtoolcache/PyPy/3.6.9/x64/lib_pypy/_sqlite3.py", line 1180, in _set_params
"probably unsupported type." % i)
_sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type.

# Fixed code
def execute(self, sql, parameters=()):
    """Same as :meth:`python:sqlite3.Connection.execute`."""
    if self.debug:
        tail = " with {!r}".format(parameters) if parameters else ""
        self.debug.write("Executing {!r}{}".format(sql, tail))
    try:
        try:
            return self.con.execute(sql, parameters)
        except Exception:
            # In some cases, an error might happen that isn't really an
            # error.  Try again immediately.
            # https://github.com/nedbat/coveragepy/issues/1010
            return self.con.execute(sql, parameters)
    except sqlite3.Error as exc:
        msg = str(exc)
        try:
            # `execute` is the first thing we do with the database, so try
            # hard to provide useful hints if something goes wrong now.
            with open(self.filename, "rb") as bad_file:
                cov4_sig = b"!coverage.py: This is a private format"
                if bad_file.read(len(cov4_sig)) == cov4_sig:
                    msg = (
                        "Looks like a coverage 4.x data file. "
                        "Are you mixing versions of coverage?"
                    )
        except Exception:
            pass
        if self.debug:
            self.debug.write("EXCEPTION from execute: {}".format(msg))
        raise CoverageException(
            "Couldn't use data file {!r}: {}".format(self.filename, msg)
        )