diff --git a/CHANGES.rst b/CHANGES.rst index aef28f3fa..c5a71ee87 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -24,7 +24,8 @@ want to know what's different in 5.0 since 4.5.x, see :ref:`whatsnew5x`. Unreleased ---------- -Nothing yet. +- Fix another rarer instance of "Error binding parameter 0 - probably + unsupported type." (`issue 1010`_). .. _changes_60b1: diff --git a/coverage/sqldata.py b/coverage/sqldata.py index b2133026e..db3ab73ac 100644 --- a/coverage/sqldata.py +++ b/coverage/sqldata.py @@ -1119,7 +1119,13 @@ def executemany(self, sql, data): if self.debug: data = list(data) self.debug.write(f"Executing many {sql!r} with {len(data)} rows") - return self.con.executemany(sql, data) + try: + return self.con.executemany(sql, data) + 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.executemany(sql, data) def executescript(self, script): """Same as :meth:`python:sqlite3.Connection.executescript`."""