[Sqlalchemy-tickets] Issue #3920: MySQLDialect.get_table_names() returns empty list (zzzeek/sqlalch
Brought to you by:
zzzeek
From: Vadim Y. <iss...@bi...> - 2017-02-26 21:41:21
|
New issue 3920: MySQLDialect.get_table_names() returns empty list https://bitbucket.org/zzzeek/sqlalchemy/issues/3920/mysqldialectget_table_names-returns-empty Vadim Yanko: I used `mysql-connector==2.1.4`, but accroding to the [documentation](https://dev.mysql.com/doc/relnotes/connector-python/en/news-2-0-0.html) connector returns `bytearray` types: > In **Connector/Python 1.x**, the output is: > Using Python 2: [('1',)] > Using Python 3: [(b'1',)] > In **Connector/Python 2.0**, for both Python versions, the output is: `[(bytearray(b'1'),)]` So, I realize that the only way to make fast solution for my project -- creating monkey-patch of MySQLDialect method mentioned above. ### Solution: Added `.decode('utf-8')` to row[0] and row[1] variables. But, I think that you may know other, more elegant way to solve this problem. If not -- write to me, please. I'd like to write PR with fix by myself. Responsible: zzzeek |