#10126 closed defect (fixed)
dynfields.html produce Genshi UnicodeDecodeError with localized ticket type
| Reported by: | Boris Savelev | Owned by: | Rob Guttman | 
|---|---|---|---|
| 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 (0)
Change History (10)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
| Trac Release: | 0.11 → 0.12 | 
|---|
comment:3 Changed 13 years ago by
| Keywords: | patch added | 
|---|
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
comment:4 Changed 13 years ago by
| Keywords: | UnicodeDecodeError added | 
|---|
comment:5 Changed 13 years ago by
| Status: | new → 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?
comment:6 Changed 13 years ago by
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
comment:7 Changed 13 years ago by
comment:8 Changed 13 years ago by
| Resolution: | → fixed | 
|---|---|
| Status: | assigned → closed | 
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..




ticket-custom