diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-11-07 15:47:15 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-11-10 11:24:53 -0500 |
commit | bd2a6e9b161251606b64d299faec583d55c2e802 (patch) | |
tree | cb9e304b72be61c59709caa792920515afc26c32 /lib/sqlalchemy/dialects/mysql/mysqlconnector.py | |
parent | 0c6071513fea9d183dc67979a239dff746992571 (diff) | |
download | sqlalchemy-bd2a6e9b161251606b64d299faec583d55c2e802.tar.gz |
removals: all unicode encoding / decoding
Removed here includes:
* convert_unicode parameters
* encoding create_engine() parameter
* description encoding support
* "non-unicode fallback" modes under Python 2
* String symbols regarding Python 2 non-unicode fallbacks
* any concept of DBAPIs that don't accept unicode
statements, unicode bound parameters, or that return bytes
for strings anywhere except an explicit Binary / BLOB
type
* unicode processors in Python / C
Risk factors:
* Whether all DBAPIs do in fact return Unicode objects for
all entries in cursor.description now
* There was logic for mysql-connector trying to determine
description encoding. A quick test shows Unicode coming
back but it's not clear if there are still edge cases where
they return bytes. if so, these are bugs in that driver,
and at most we would only work around it in the mysql-connector
DBAPI itself (but we won't do that either).
* It seems like Oracle 8 was not expecting unicode bound parameters.
I'm assuming this was all Python 2 stuff and does not apply
for modern cx_Oracle under Python 3.
* third party dialects relying upon built in unicode encoding/decoding
but it's hard to imagine any non-SQLAlchemy database driver not
dealing exclusively in Python unicode strings in Python 3
Change-Id: I97d762ef6d4dd836487b714d57d8136d0310f28a
References: #7257
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/mysqlconnector.py')
-rw-r--r-- | lib/sqlalchemy/dialects/mysql/mysqlconnector.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/mysqlconnector.py b/lib/sqlalchemy/dialects/mysql/mysqlconnector.py index e17da3174..fef4f14ca 100644 --- a/lib/sqlalchemy/dialects/mysql/mysqlconnector.py +++ b/lib/sqlalchemy/dialects/mysql/mysqlconnector.py @@ -27,7 +27,6 @@ from .base import BIT from .base import MySQLCompiler from .base import MySQLDialect from .base import MySQLIdentifierPreparer -from ... import processors from ... import util @@ -87,8 +86,6 @@ class MySQLDialect_mysqlconnector(MySQLDialect): driver = "mysqlconnector" supports_statement_cache = True - supports_unicode_binds = True - supports_sane_rowcount = True supports_sane_multi_rowcount = True @@ -101,29 +98,6 @@ class MySQLDialect_mysqlconnector(MySQLDialect): colspecs = util.update_copy(MySQLDialect.colspecs, {BIT: _myconnpyBIT}) - def __init__(self, *arg, **kw): - super(MySQLDialect_mysqlconnector, self).__init__(*arg, **kw) - - # hack description encoding since mysqlconnector randomly - # returns bytes or not - self._description_decoder = ( - processors.to_conditional_unicode_processor_factory - )(self.description_encoding) - - def _check_unicode_description(self, connection): - # hack description encoding since mysqlconnector randomly - # returns bytes or not - return False - - @property - def description_encoding(self): - # total guess - return "latin-1" - - @util.memoized_property - def supports_unicode_statements(self): - return util.py3k or self._mysqlconnector_version_info > (2, 0) - @classmethod def dbapi(cls): from mysql import connector |