Opened 12 years ago

Closed 12 years ago

#5770 closed (fixed)

Unicode error in admin documentation

Reported by: tobutaz+bugs@… Owned by: nobody
Component: contrib.admin Version: 0.96
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


You can use the french locale to trigger the bug.

Go to the admin doc view, go to the tags view: /admin/doc/tags/

According to the backtrace, django has problems with this translation:

#: contrib/admin/views/ contrib/admin/views/
#: contrib/admin/views/
msgid "tag:"
msgstr "mot-clé :"


Traceback (most recent call last):
File "/var/lib/python-support/python2.5/django/core/handlers/" in get_response
  72. response = middleware_method(request, callback, callback_args, callback_kwargs)
File "/datas/pressblog/bin/pressblog/middleware/" in process_view
  28. response = view_func(request, *view_args, **view_kwargs)
File "/var/lib/python-support/python2.5/django/contrib/admin/views/" in _checklogin
  55. return view_func(request, *args, **kwargs)
File "/var/lib/python-support/python2.5/django/contrib/admin/views/" in template_tag_index
  48. body = utils.parse_rst(body, 'tag', _('tag:') + tag_name)
File "/var/lib/python-support/python2.5/django/contrib/admin/" in parse_rst
  68. settings_overrides=overrides)
File "/usr/lib/python2.5/site-packages/docutils/" in publish_parts
  431. enable_exit_status=enable_exit_status)
File "/usr/lib/python2.5/site-packages/docutils/" in publish_programmatically
  612. output = pub.publish(enable_exit_status=enable_exit_status)
File "/usr/lib/python2.5/site-packages/docutils/" in publish
  204. self.settings)
File "/usr/lib/python2.5/site-packages/docutils/readers/" in read
  71. self.parse()
File "/usr/lib/python2.5/site-packages/docutils/readers/" in parse
  77. self.parser.parse(self.input, document)
File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/" in parse
  155., document, inliner=self.inliner)
File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/" in run
  171. input_source=document['source'])
File "/usr/lib/python2.5/site-packages/docutils/" in run
  234. context, state, transitions)
File "/usr/lib/python2.5/site-packages/docutils/" in check_line
  422. return method(match, context, next_state)
File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/" in text
  2631. source=source, line=lineno)
File "/usr/lib/python2.5/site-packages/docutils/" in error
  209. return self.system_message(3, *args, **kwargs)
File "/usr/lib/python2.5/site-packages/docutils/" in system_message
  172. msgtext = msg.astext().encode(self.encoding, self.error_handler)
File "/usr/lib/python2.5/site-packages/docutils/" in astext
  1310. self['level'], Element.astext(self))

  UnicodeDecodeError at /admin/doc/tags/
  'ascii' codec can't decode byte 0xc3 in position 7: ordinal not in range(128)

Change History (3)

comment:1 Changed 12 years ago by durdinator

I can't replicate this on trunk -- although the /admin/doc/tags/ page doesn't appear to be translating that string anywhere, as "mot-clé" is nowhere on the page. Have you got any nonstandard tag libraries installed that might be triggering the error?

comment:2 Changed 12 years ago by anonymous <tobutaz+bugs@…>

I've just checked, _('tag:') does appear in

File "/var/lib/python-support/python2.5/django/contrib/admin/views/" in template_tag_index
  48. body = utils.parse_rst(body, 'tag', _('tag:') + tag_name)

Maybe you don't have the french translation installed (I'm using a distribution package), you could then hardcode it in to trigger the bug.

Also, I have this in LANGUAGE_CODE = 'fr-FR'

comment:3 Changed 12 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

Non-ASCII characters in translations were a problem in 0.96. This is fixed on trunk, though. Firstly because the error that was trying to be displayed is fixed in [6539] and secondly because we use ugettext() everywhere.

Please reopen if you can repeat it on trunk, but as far as I can work out, it's fixed (I could generate the problem in 0.96, but not in trunk).

Note: See TracTickets for help on using tickets.
Back to Top