Modify

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

Description

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 milncheckbox.py 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/main.py", line 613, in _dispatch_request
  dispatcher.dispatch(req)
File "/usr/local/lib/python2.7/dist-packages/trac/web/main.py", line 253, in dispatch
  resp = chosen_handler.process_request(req)
File "/usr/local/lib/python2.7/dist-packages/trac/admin/web_ui.py", line 108, in process_request
  provider.render_admin_panel(req, cat_id, panel_id, path_info)
File "build/bdist.linux-armv7l/egg/inieditorpanel/web_ui.py", 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/web_ui.py", line 507, in _read_section_config
  options[option_name] = _assemble_option(option_name, stored_value)
File "build/bdist.linux-armv7l/egg/inieditorpanel/web_ui.py", 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/web_ui.py", line 547, in _gather_option_data
  doc = dgettext(option.doc_domain, doc)
File "/usr/local/lib/python2.7/dist-packages/trac/util/translation.py", line 210, in dgettext
  return _dgettext()
File "/usr/local/lib/python2.7/dist-packages/trac/util/translation.py", line 207, in _dgettext
  return safefmt(self.active.dugettext(domain, string), kwargs)
File "/usr/lib/python2.7/dist-packages/babel/support.py", line 304, in udgettext
  return self._domains.get(domain, self).ugettext(message)
File "/usr/lib/python2.7/gettext.py", line 403, in ugettext
  return self._fallback.ugettext(message)
File "/usr/lib/python2.7/gettext.py", line 404, in ugettext
  return unicode(message)

Attachments (1)

FIXED-milncheckbox.py.gz (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: FIXED-milncheckbox.py.gz added

comment:1 Changed 5 years ago by Graham Miln

Thank you.

Modify Ticket

Change Properties
Set your email in Preferences
Action
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.