#17566: RegexURLResolver.__repr__(self) is not unicode safe.
-------------------------------+---------------------------------------
     Reporter:  otto           |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  reopened
    Component:  Core (URLs)    |                  Version:  1.4-alpha-1
     Severity:  Normal         |               Resolution:
     Keywords:  unicode        |             Triage Stage:  Unreviewed
    Has patch:  1              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+---------------------------------------
Changes (by vitalije):

 * status:  closed => reopened
 * keywords:   => unicode
 * resolution:  needsinfo =>


Comment:

 I have noticed the same bug but I believe it is consequence of having
 app_name that has non ascii characters in it. May be that it is not
 supposed to have, but then, I couldn't find other way to display localised
 app_name in django's admin page. It is triggered only when I try to open
 missing link during the generation of technical_404_response. Here is a
 log:

 {{{
 Django version 1.4, using settings 'eprod.settings'
 Development server is running at http://192.168.1.195:8100/
 Quit the server with CONTROL-C.
 Traceback (most recent call last):
   File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
     self.result = application(self.environ, self.start_response)
   File "/usr/local/lib/python2.7/dist-
 packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
     return self.application(environ, start_response)
   File "/usr/local/lib/python2.7/dist-
 packages/django/core/handlers/wsgi.py", line 241, in __call__
     response = self.get_response(request)
   File "/usr/local/lib/python2.7/dist-
 packages/django/core/handlers/base.py", line 146, in get_response
     response = debug.technical_404_response(request, e)
   File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py",
 line 432, in technical_404_response
     'reason': smart_str(exception, errors='replace'),
   File "/usr/local/lib/python2.7/dist-packages/django/utils/encoding.py",
 line 116, in smart_str
     return str(s)
   File "/usr/local/lib/python2.7/dist-
 packages/django/core/urlresolvers.py", line 235, in __repr__
     return smart_str(u'<%s %s (%s:%s) %s>' % (self.__class__.__name__,
 self.urlconf_name, self.app_name, self.namespace, self.regex.pattern))
   File "/usr/local/lib/python2.7/dist-
 packages/django/core/urlresolvers.py", line 235, in __repr__
     return smart_str(u'<%s %s (%s:%s) %s>' % (self.__class__.__name__,
 self.urlconf_name, self.app_name, self.namespace, self.regex.pattern))
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 18:
 ordinal not in range(128)
 }}}

 I hope this would help to solve the problem. In case that app_name has to
 be ascii then what is the proper way to force django admin application to
 show non-ascii applications names? In fact I would prefer to have plain
 ascii urls but display name or verbose_name or similar displayed in admin
 pages.
 Vitalije

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17566#comment:2>
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to