Changed last_executed_query to avoid raising exceptions on non-utf8-encoded parameter data.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12737 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
bb72aca5d4
commit
ea288f14e0
|
@ -206,7 +206,7 @@ class BaseDatabaseOperations(object):
|
||||||
from django.utils.encoding import smart_unicode, force_unicode
|
from django.utils.encoding import smart_unicode, force_unicode
|
||||||
|
|
||||||
# Convert params to contain Unicode values.
|
# Convert params to contain Unicode values.
|
||||||
to_unicode = lambda s: force_unicode(s, strings_only=True)
|
to_unicode = lambda s: force_unicode(s, strings_only=True, errors='replace')
|
||||||
if isinstance(params, (list, tuple)):
|
if isinstance(params, (list, tuple)):
|
||||||
u_params = tuple([to_unicode(val) for val in params])
|
u_params = tuple([to_unicode(val) for val in params])
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue