Modify

Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#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 12 years ago by Boris Savelev

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 =

comment:2 Changed 12 years ago by Boris Savelev

Trac Release: 0.110.12

comment:3 Changed 12 years ago by Boris Savelev

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 12 years ago by Adrian Fritz

Keywords: UnicodeDecodeError added

comment:5 Changed 12 years ago by Rob Guttman

Status: newassigned

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 12 years ago by Boris Savelev

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 12 years ago by Rob Guttman

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

comment:8 Changed 12 years ago by Rob Guttman

Resolution: fixed
Status: assignedclosed

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..

comment:9 Changed 11 years ago by Ryan J Ollos

See also #10476 for a problem caused by [11655].

comment:10 Changed 10 years ago by Ryan J Ollos

In 13650:

Bump version to 1.2.4. Refs #11378, #11118, #11523, #10126, #9605, #9986, #9996, #8971.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Rob Guttman.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.