Ticket #10126 (closed defect: fixed)

Opened 11 months ago

Last modified 11 months ago

dynfields.html produce Genshi UnicodeDecodeError with localized ticket type

Reported by: bsavelev Assigned to: robguttman
Priority: normal Component: DynamicFieldsPlugin
Severity: normal Keywords: patch UnicodeDecodeError
Cc: Trac Release: 0.12

Description

Hello! I use trac 0.12 and TracDynamicFields?-1.2.3-py2.6 from latest svn/0.11

I have 2 ticket type in ru_RU.utf-8 locale:

задача
записка

When trac try to render dynfields.html its generate http 500 error with 'Genshi UnicodeDecodeError? exception'

Attachments

Change History

06/27/12 10:30:21 changed by bsavelev

ticket-custom

[ticket-custom]
due_date = text
due_date.date = true
due_date.date_empty = true
due_date.label = Срок исполнения
due_date.show_when_type = задача
due_date.value =

06/27/12 10:30:28 changed by bsavelev

  • release changed from 0.11 to 0.12.

06/27/12 12:31:59 changed by bsavelev

  • keywords set to patch.
Index: rules.py
===================================================================
--- rules.py    (revision 11696)
+++ rules.py    (working copy)
@@ -229,6 +229,7 @@
         return None
     
     def update_spec(self, req, key, opts, spec):
+        from trac.util.text import to_unicode
         target = spec['target']
         trigger = spec['trigger']
         
@@ -237,7 +238,7 @@
         match = spec_re.match(key)
         if match:
             spec['op'] = match.groupdict()['op']
-            spec['trigger_value'] = opts[key]
+            spec['trigger_value'] = to_unicode(opts[key])
             spec['hide_always'] = \
                 str(self._is_always_hidden(req, key, opts, spec)).lower()
         else: # assume 'hide_always' or group rule

this patch works for me

06/28/12 04:40:27 changed by AdrianFritz

  • keywords changed from patch to patch UnicodeDecodeError.

06/28/12 04:43:42 changed by robguttman

  • status changed from new to assigned.

bsavelev, thanks for these details and the patch. I will do some testing myself.

Question: is this unicode support sufficient for your needs or do you also need the internationalization support found in the (unmaintained) 0.12 branch of this plugin?

06/28/12 07:49:06 changed by bsavelev

thanks for plugin)

A: i18n is always good. I think the problem is not just me. it may relate to any who have non-ASCII types of tickets

06/28/12 14:50:16 changed by robguttman

(In [11699]) refs #10126: support unicode characters in trac.ini config.

06/28/12 14:52:38 changed by robguttman

  • status changed from assigned to closed.
  • resolution set to fixed.

This should be fixed now.

Parsing trac.ini directly to support case sensitivity (a fix I made last week) ended up breaking the unicode support that's built-in to Trac's config parser..


Add/Change #10126 (dynfields.html produce Genshi UnicodeDecodeError with localized ticket type)




Change Properties
Action