Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Claude Paroz authored August 29, 2013

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. 5  django/db/backends/sqlite3/base.py
5  django/db/backends/sqlite3/base.py
@@ -84,8 +84,9 @@ def decoder(conv_func):
84 84
 
85 85
 Database.register_adapter(datetime.datetime, adapt_datetime_with_timezone_support)
86 86
 Database.register_adapter(decimal.Decimal, util.rev_typecast_decimal)
87  
-Database.register_adapter(str, lambda s: s.decode('utf-8'))
88  
-Database.register_adapter(SafeBytes, lambda s: s.decode('utf-8'))
  87
+if not six.PY3:
  88
+    Database.register_adapter(str, lambda s: s.decode('utf-8'))
  89
+    Database.register_adapter(SafeBytes, lambda s: s.decode('utf-8'))
89 90
 
90 91
 
91 92
 class DatabaseFeatures(BaseDatabaseFeatures):

0 notes on commit 1696376

Please sign in to comment.
Something went wrong with that request. Please try again.