diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py index 841ca92f3e..c6cda55229 100644 --- a/django/db/backends/sqlite3/base.py +++ b/django/db/backends/sqlite3/base.py @@ -84,8 +84,9 @@ Database.register_converter(str("decimal"), decoder(util.typecast_decimal)) Database.register_adapter(datetime.datetime, adapt_datetime_with_timezone_support) Database.register_adapter(decimal.Decimal, util.rev_typecast_decimal) -Database.register_adapter(str, lambda s: s.decode('utf-8')) -Database.register_adapter(SafeBytes, lambda s: s.decode('utf-8')) +if not six.PY3: + Database.register_adapter(str, lambda s: s.decode('utf-8')) + Database.register_adapter(SafeBytes, lambda s: s.decode('utf-8')) class DatabaseFeatures(BaseDatabaseFeatures):