Author: mtredinnick
Date: 2007-05-12 10:40:46 -0500 (Sat, 12 May 2007)
New Revision: 5208

Modified:
   django/branches/unicode/django/db/backends/util.py
Log:
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.


Modified: django/branches/unicode/django/db/backends/util.py
===================================================================
--- django/branches/unicode/django/db/backends/util.py  2007-05-12 15:38:24 UTC 
(rev 5207)
+++ django/branches/unicode/django/db/backends/util.py  2007-05-12 15:40:46 UTC 
(rev 5208)
@@ -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 @@
             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),
             })
 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to