Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

Thanks lvella at gmail.com for the report.
  • Loading branch information...
commit 169637649baa012a8a77b17465c5c0c1085336ea 1 parent 112799e
@claudep claudep authored
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):
Please sign in to comment.
Something went wrong with that request. Please try again.