asyncmy
asyncmy copied to clipboard
AttributeError raised if set ssl with boolean
trafficstars
I'm using tortoise-orm with asyncmy, with DB_URL and with ssl parameter with docs like this.
await Tortoise.init(
db_url="mysql://user:pswd@host/db?ssl=True",
use_tz=True,
)
When I switching from aiomysql to asyncmy, the error occurs.
File "/***/tortoise/backends/mysql/client.py", line 114, in create_connection
self._pool = await mysql.create_pool(password=self.password, **self._template)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "asyncmy/pool.pyx", line 216, in _create_pool
File "asyncmy/pool.pyx", line 217, in asyncmy.pool._create_pool
File "asyncmy/pool.pyx", line 145, in fill_free_pool
File "asyncmy/connection.pyx", line 1340, in _connect
File "asyncmy/connection.pyx", line 232, in asyncmy.connection.Connection.__init__
File "asyncmy/connection.pyx", line 303, in asyncmy.connection.Connection._create_ssl_ctx
AttributeError: 'bool' object has no attribute 'get'
I think there should be a default setting if the ssl param is not a dict instance. Everything works on aiomysql btw.
What version?
tested with asyncmy v0.2.9