Error parsing server version with cymysql dialect

Issue #2934 resolved
Former user created an issue

Last line of the traceback says it all:

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    meta.reflect(bind=engine)
  File "/Users/project/lib/python3.3/site-packages/sqlalchemy/sql/schema.py", line 3215, in reflect
    with bind.connect() as conn:
  File "/Users/project/lib/python3.3/site-packages/sqlalchemy/engine/base.py", line 1678, in connect
    return self._connection_cls(self, **kwargs)
  File "/Users/project/lib/python3.3/site-packages/sqlalchemy/engine/base.py", line 59, in __init__
    self.__connection = connection or engine.raw_connection()
  File "/Users/project/lib/python3.3/site-packages/sqlalchemy/engine/base.py", line 1747, in raw_connection
    return self.pool.unique_connection()
  File "/Users/project/lib/python3.3/site-packages/sqlalchemy/pool.py", line 272, in unique_connection
    return _ConnectionFairy._checkout(self)
  File "/Users/project/lib/python3.3/site-packages/sqlalchemy/pool.py", line 608, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/Users/project/lib/python3.3/site-packages/sqlalchemy/pool.py", line 425, in checkout
    rec = pool._do_get()
  File "/Users/project/lib/python3.3/site-packages/sqlalchemy/pool.py", line 928, in _do_get
    return self._create_connection()
  File "/Users/project/lib/python3.3/site-packages/sqlalchemy/pool.py", line 277, in _create_connection
    return _ConnectionRecord(self)
  File "/Users/project/lib/python3.3/site-packages/sqlalchemy/pool.py", line 401, in __init__
    exec_once(self.connection, self)
  File "/Users/project/lib/python3.3/site-packages/sqlalchemy/event/attr.py", line 238, in exec_once
    self(*args, **kw)
  File "/Users/project/lib/python3.3/site-packages/sqlalchemy/event/attr.py", line 247, in __call__
    fn(*args, **kw)
  File "/Users/project/lib/python3.3/site-packages/sqlalchemy/util/langhelpers.py", line 1180, in go
    return once_fn(*arg, **kw)
  File "/Users/project/lib/python3.3/site-packages/sqlalchemy/engine/strategies.py", line 166, in first_connect
    dialect.initialize(c)
  File "/Users/project/lib/python3.3/site-packages/sqlalchemy/dialects/mysql/base.py", line 2207, in initialize
    default.DefaultDialect.initialize(self, connection)
  File "/Users/project/lib/python3.3/site-packages/sqlalchemy/engine/default.py", line 222, in initialize
    self._get_server_version_info(connection)
  File "/Users/project/lib/python3.3/site-packages/sqlalchemy/dialects/mysql/cymysql.py", line 57, in _get_server_version_info
    version = [for v in dbapi_con.server_version.split('.')](int(v))
  File "/Users/project/lib/python3.3/site-packages/sqlalchemy/dialects/mysql/cymysql.py", line 57, in <listcomp>
    version = [for v in dbapi_con.server_version.split('.')](int(v))
ValueError: invalid literal for int() with base 10: '33a-MariaDB'

Comments (5)

  1. Mike Bayer repo owner

    ugh, OK cymysql is totally someone that sends me pullreqs. that person is over here: https://github.com/nakagami/sqlalchemy (author of cymysql) maybe we can get them to handle this? what's the appeal of cymysql over the more standard drivers like mysql-python, oursql (runs in py3k), mysql-connector (runs in py3k), pymysql (runs in py3k) ?

  2. Former user Account Deleted

    cymysql is supposed to be pymysql with some Cython extensions.

    oursql was giving me trouble with the TIME type, and I haven't tried mysql-connector -- wasn't sure if it would work with MariaDB

  3. Mike Bayer repo owner

    that's fine. Im sure you can appreciate it's pretty annoying on my end that I have to support...technically eight different MySQL DBAPIs (six realistically) ;)

  4. Former user Account Deleted

    I can and do appreciate it! I debated for a while if this was even worthy of reporting.

    Anyway, if there's no fix from the cymysql author by the time I get home, I'll send a pullreq. It looks like the code from the oursql adapter will work.

  5. Log in to comment