diff --git a/frappe/database.py b/frappe/database.py index eebaf3fbb7..af265b5857 100644 --- a/frappe/database.py +++ b/frappe/database.py @@ -18,7 +18,7 @@ import redis import frappe.model.meta from frappe.utils import now, get_datetime, cstr from frappe import _ -from types import StringType, UnicodeType +from six import text_type, binary_type from frappe.utils.global_search import sync_global_search from frappe.model.utils.link_count import flush_local_link_count from six import iteritems, text_type @@ -69,8 +69,8 @@ class Database: use_unicode=True, charset='utf8mb4') self._conn.converter[246]=float self._conn.converter[12]=get_datetime - self._conn.encoders[UnicodeWithAttrs] = self._conn.encoders[UnicodeType] - self._conn.encoders[DateTimeDeltaType] = self._conn.encoders[StringType] + self._conn.encoders[UnicodeWithAttrs] = self._conn.encoders[text_type] + self._conn.encoders[DateTimeDeltaType] = self._conn.encoders[binary_type] MYSQL_OPTION_MULTI_STATEMENTS_OFF = 1 self._conn.set_server_option(MYSQL_OPTION_MULTI_STATEMENTS_OFF)