diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 23b752f22..bc31646bf 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -12,6 +12,9 @@ Changelog 0.26.0 (unreleased) ------------------- +Fixed +^^^^^ +- Fix exception when creating aiosqlite connections on aiosqlite==0.22.0 (#2035) 0.25 ==== diff --git a/tortoise/backends/sqlite/client.py b/tortoise/backends/sqlite/client.py index dc8ac09b5..175356057 100644 --- a/tortoise/backends/sqlite/client.py +++ b/tortoise/backends/sqlite/client.py @@ -78,9 +78,7 @@ def __init__(self, file_path: str, **kwargs: Any) -> None: async def create_connection(self, with_db: bool) -> None: if not self._connection: # pragma: no branch - self._connection = aiosqlite.connect(self.filename, isolation_level=None) - self._connection.start() - await self._connection._connect() + self._connection = await aiosqlite.connect(self.filename, isolation_level=None) self._connection._conn.row_factory = sqlite3.Row for pragma, val in self.pragmas.items(): cursor = await self._connection.execute(f"PRAGMA {pragma}={val}")