Opened 5 years ago

Last modified 5 years ago

#13338 new defect

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 149: ordinal not in range(128)

Reported by: oliver.joos@… Owned by: Graham Miln
Priority: normal Component: MilnCheckboxPlugin
Severity: major Keywords:
Cc: Trac Release: 1.2


I have Trac 1.2.2 on Python 2.7.9 (newest on Raspbian) and also the TracIniAdminPanelPlugin 1.0.2 (current trunk).

Installing MilnCheckboxPlugin on Admin-Plugins page worked as expected. But when I move to Admin-iniEditor page and try to open the section of miln-checkbox then a Traceback shows.

I guess this is caused by non-ascii chars in sourcecode. iniEditor seems to ignore -*- coding: utf-8 -*-. Since my other plugins do not have this problem, I solved it simply by replacing © on line 3 with (C) and the checkbox characters on lines 28, 42 and 45 with \uXXXX - see my attachment.

Feel free to merge my changes into your plugin!

Traceback in detail (current frame first!):

File "/usr/local/lib/python2.7/dist-packages/trac/web/", line 613, in _dispatch_request
File "/usr/local/lib/python2.7/dist-packages/trac/web/", line 253, in dispatch
  resp = chosen_handler.process_request(req)
File "/usr/local/lib/python2.7/dist-packages/trac/admin/", line 108, in process_request
  provider.render_admin_panel(req, cat_id, panel_id, path_info)
File "build/bdist.linux-armv7l/egg/inieditorpanel/", line 205, in render_admin_panel
  sections[path_info] = self._read_section_config(req, path_info, default_values)
File "build/bdist.linux-armv7l/egg/inieditorpanel/", line 507, in _read_section_config
  options[option_name] = _assemble_option(option_name, stored_value)
File "build/bdist.linux-armv7l/egg/inieditorpanel/", line 491, in _assemble_option
  option = self._gather_option_data(req, section_name, option_name, section_default_values)
File "build/bdist.linux-armv7l/egg/inieditorpanel/", line 547, in _gather_option_data
  doc = dgettext(option.doc_domain, doc)
File "/usr/local/lib/python2.7/dist-packages/trac/util/", line 210, in dgettext
  return _dgettext()
File "/usr/local/lib/python2.7/dist-packages/trac/util/", line 207, in _dgettext
  return safefmt(, string), kwargs)
File "/usr/lib/python2.7/dist-packages/babel/", line 304, in udgettext
  return self._domains.get(domain, self).ugettext(message)
File "/usr/lib/python2.7/", line 403, in ugettext
  return self._fallback.ugettext(message)
File "/usr/lib/python2.7/", line 404, in ugettext
  return unicode(message)

Attachments (1) (850 bytes) - added by oliver.joos@… 5 years ago.

Download all attachments as: .zip

Change History (2)

Changed 5 years ago by oliver.joos@…

Attachment: added

comment:1 Changed 5 years ago by Graham Miln

Thank you.

Modify Ticket

Change Properties
Set your email in Preferences
as new The owner will remain Graham Miln.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.