Skip to content

Commit

Permalink
unicode: Make sure we don't try to insert unicode data into bytestrin…
Browse files Browse the repository at this point in the history
…gs 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
  • Loading branch information
malcolmt committed May 12, 2007
1 parent 50ef85f commit bc04465
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django/db/backends/util.py
@@ -1,5 +1,6 @@
import datetime import datetime
from time import time from time import time
from django.utils.encoding import smart_unicode


class CursorDebugWrapper(object): class CursorDebugWrapper(object):
def __init__(self, cursor, db): def __init__(self, cursor, db):
Expand All @@ -17,7 +18,7 @@ def execute(self, sql, params=()):
if not isinstance(params, (tuple, dict)): if not isinstance(params, (tuple, dict)):
params = tuple(params) params = tuple(params)
self.db.queries.append({ self.db.queries.append({
'sql': sql % params, 'sql': smart_unicode(sql) % params,
'time': "%.3f" % (stop - start), 'time': "%.3f" % (stop - start),
}) })


Expand Down

0 comments on commit bc04465

Please sign in to comment.