Permalink
Browse files

Fixed #20984 -- Stopped decoding bytes in sqlite3 adapter on Python 3

Thanks lvella at gmail.com for the report.
  • Loading branch information...
1 parent 112799e commit 169637649baa012a8a77b17465c5c0c1085336ea @claudep claudep committed Aug 29, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 django/db/backends/sqlite3/base.py
View
5 django/db/backends/sqlite3/base.py
@@ -84,8 +84,9 @@ def decoder(conv_func):
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):

0 comments on commit 1696376

Please sign in to comment.