summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-05-12 15:40:46 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-05-12 15:40:46 +0000
commitbc044651aaed9eedbc195414a71bde4e375a7c73 (patch)
treea5be83c818fba883ad27a8384b963a5380f7515c
parent50ef85f6e234085bef0f2f7c7828e08886d43cbb (diff)
unicode: Make sure we don't try to insert unicode data into bytestrings in the
debug database cursor. Might not be necessary, but it can't hurt in any case. Refs #3891. git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5208 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/db/backends/util.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/backends/util.py b/django/db/backends/util.py
index d14a337ca2..000d03eae4 100644
--- a/django/db/backends/util.py
+++ b/django/db/backends/util.py
@@ -1,5 +1,6 @@
import datetime
from time import time
+from django.utils.encoding import smart_unicode
class CursorDebugWrapper(object):
def __init__(self, cursor, db):
@@ -17,7 +18,7 @@ class CursorDebugWrapper(object):
if not isinstance(params, (tuple, dict)):
params = tuple(params)
self.db.queries.append({
- 'sql': sql % params,
+ 'sql': smart_unicode(sql) % params,
'time': "%.3f" % (stop - start),
})