Modify

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#5901 closed defect (fixed)

[Patch] UnicodeDecodeError

Reported by: anonymous Owned by: rjollos
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 5 years ago by jun66j5

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 4 years ago by rjollos

  • Summary changed from UnicodeDecodeError to [Patch] UnicodeDecodeError

#8459 closed as a duplicate.

comment:3 Changed 4 years ago by rjollos

  • Owner changed from takanorig to rjollos
  • Status changed from new to assigned

comment:4 follow-up: Changed 4 years ago by 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.

comment:5 Changed 4 years ago by rjollos

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

comment:6 Changed 4 years ago by rjollos

  • Resolution set to fixed
  • Status changed from assigned to closed

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

comment:7 in reply to: ↑ 4 Changed 4 years ago by jun66j5

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

Add Comment

Modify Ticket

Action
as closed The owner will remain rjollos.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.