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

Thanks lvella at gmail.com for the report.
This commit is contained in:
Claude Paroz 2013-08-29 08:35:17 +02:00
parent 112799e9a8
commit 169637649b
1 changed files with 3 additions and 2 deletions

View File

@ -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):