Modify

Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#5901 closed defect (fixed)

[Patch] UnicodeDecodeError

Reported by: anonymous Owned by: Ryan J Ollos
Priority: normal Component: WorkflowEditorPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Trac 0.11.5.ja1においては,テンプレート (テンプレート内の位置が特定できません) のレンダリング中に Genshi のエラー UnicodeDecodeError が発生しました。

Attachments (0)

Change History (7)

comment:1 Changed 15 years ago by Jun Omae

I use workfloweditorplugin/0.11@6348 and have a same problem.

In my environment, the problem is fixed by the below patch.

  • workfloweditor/workfloweditor_admin.py

     
    116116        # read defalut config
    117117        template = Chrome(self.env).load_template(init_file, 'text')
    118118        stream = template.generate()
    119         default_config = stream.render('text')
     119        default_config = stream.render('text', encoding=None)
    120120
    121121        page_param['workflow_default_config'] = default_config
    122122

comment:2 Changed 14 years ago by Ryan J Ollos

Summary: UnicodeDecodeError[Patch] UnicodeDecodeError

#8459 closed as a duplicate.

comment:3 Changed 14 years ago by Ryan J Ollos

Owner: changed from Takanori Suzuki to Ryan J Ollos
Status: newassigned

comment:4 Changed 14 years ago by Ryan J Ollos

I'm going to go ahead and apply this patch because I see encoding=None as an argument to render when grepping the Trac codebase, but I'm having trouble reproducing the issue. If someone can send the specific workflow test that reproduces the error, that would be a big help. Please test the latest checkin as well.

comment:5 Changed 14 years ago by Ryan J Ollos

(In [9976]) Fixed UnicodeDecode error. Thanks to jun66j5 for the patch. Refs #5901, #8459.

comment:6 Changed 14 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

(In [9977]) Merge [9976] into 0.11 branch. Fixes #5901. Refs #8459.

comment:7 in reply to:  4 Changed 14 years ago by Jun Omae

Replying to rjollos:

I'm going to go ahead and apply this patch because I see encoding=None as an argument to render when grepping the Trac codebase, but I'm having trouble reproducing the issue. If someone can send the specific workflow test that reproduces the error, that would be a big help. Please test the latest checkin as well.

I tested the latest with Trac 0.11-stable in Japanese environment and the issue is fixed. Thanks!

BTW, render() method is in genshi.core.Stream class. When encoding=None, the method returns a unicode object.

cf. http://genshi.edgewall.org/browser/tags/0.6.0/genshi/core.py#L156

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
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.