#18461: UnicodeDecodeError in sql logger
------------------------------+--------------------
     Reporter:  zw0rk         |      Owner:  nobody
         Type:  Bug           |     Status:  new
    Component:  Core (Other)  |    Version:  master
     Severity:  Normal        |   Keywords:
 Triage Stage:  Unreviewed    |  Has patch:  0
Easy pickings:  0             |      UI/UX:  0
------------------------------+--------------------
 Trying to filter a queryset with unicode values causes UnicodeDecodeError
 in sql logger.

 {{{
 >>> User.objects.filter(last_name=u'Z')
 []
 >>> User.objects.filter(last_name=u'ะน')
 Traceback (most recent call last):
   File "<console>", line 1, in <module>
   File "/usr/lib/python2.7/site-packages/django/db/models/query.py", line
 74, in __repr__
     data = list(self[:REPR_OUTPUT_SIZE + 1])
   File "/usr/lib/python2.7/site-packages/django/db/models/query.py", line
 89, in __len__
     self._result_cache.extend(self._iter)
   File "/usr/lib/python2.7/site-packages/django/db/models/query.py", line
 294, in iterator
     for row in compiler.results_iter():
   File "/usr/lib/python2.7/site-
 packages/django/db/models/sql/compiler.py", line 764, in results_iter
     for rows in self.execute_sql(MULTI):
   File "/usr/lib/python2.7/site-
 packages/django/db/models/sql/compiler.py", line 819, in execute_sql
     cursor.execute(sql, params)
   File "/usr/lib/python2.7/site-packages/django/db/backends/util.py", line
 51, in execute
     logger.debug('(%.3f) %s; args=%s' % (duration, sql, params),
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 850:
 ordinal not in range(128)
 }}}

 This happens even right after syncdb, when django tries to create
 admin_permission objects and models have unicode verbose_name's.

 No custom loggers were installed in settings.py.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18461>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
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