From 58157be5ad31b42a1dc73e357cfdece02fd0b6ee Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Thu, 29 Aug 2013 08:35:17 +0200 Subject: [PATCH] [1.6.x] Fixed #20984 -- Stopped decoding bytes in sqlite3 adapter on Python 3 Thanks lvella at gmail.com for the report. Backport of 169637649 from master. --- django/db/backends/sqlite3/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py index 92dbf354ae..3a0a9f57b7 100644 --- a/django/db/backends/sqlite3/base.py +++ b/django/db/backends/sqlite3/base.py @@ -78,7 +78,7 @@ 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) -if Database.version_info >= (2, 4, 1): +if not six.PY3 and Database.version_info >= (2, 4, 1): # Starting in 2.4.1, the str type is not accepted anymore, therefore, # we convert all str objects to Unicode # As registering a adapter for a primitive type causes a small