Modify

Opened 9 years ago

Closed 9 years ago

#12724 closed defect (fixed)

Unicode error with genshi 0.7

Reported by: anonymous Owned by: Olemis Lang
Priority: high Component: PeerReviewPlugin
Severity: critical Keywords: Unicode genshi 0.7
Cc: Ryan J Ollos, Cinc-th Trac Release: 1.0

Description (last modified by Ryan J Ollos)

Hi, I am trying to use this plugin in trac 1.0.2. When I try to create a new review I have the following error:

2016-04-04 10:42:17,721 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/trac/web/main.py", line 512, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.7/dist-packages/trac/web/main.py", line 221, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-x86_64/egg/codereview/peerReviewView.py", line 218, in process_request
    get_workflow_markup(req, url, realm, res, {'redirect': req.href.peerReviewView(Review=review_id)})
  File "build/bdist.linux-x86_64/egg/codereview/tracgenericworkflow/api.py", line 325, in get_workflow_markup
    return HTML(tmpl.safe_substitute(tdata))
  File "/usr/lib/python2.7/dist-packages/genshi/input.py", line 442, in HTML
    return Stream(list(HTMLParser(BytesIO(text), encoding=encoding)))
  File "/usr/lib/python2.7/dist-packages/genshi/core.py", line 273, in _ensure
    event = stream.next()
  File "/usr/lib/python2.7/dist-packages/genshi/input.py", line 449, in _coalesce
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/usr/lib/python2.7/dist-packages/genshi/input.py", line 337, in _generate
    raise UnicodeError("source returned bytes, but no encoding specified")
UnicodeError: source returned bytes, but no encoding specified

Searching the net I came to the conclusion that the problem is with genshi 0.7, which I am using. Sadly I have no clue to where should I start to look withn the plugin source code to fix this.

Attachments (0)

Change History (4)

comment:1 Changed 9 years ago by anonymous

Downgrading genshi to version 0.6 fix this for me.

comment:2 Changed 9 years ago by Ryan J Ollos

Description: modified (diff)

comment:3 Changed 9 years ago by Ryan J Ollos

Cc: Cinc-th added

comment:4 Changed 9 years ago by Cinc-th

Resolution: fixed
Status: newclosed

In 15456:

PeerReviewPlugin: Compatibility fix for Trac 1.0.x. Genshi 0.7 needs encoding when calling HTML() with unicode string: HTML(u'foo', encoding="utf-8") instead of HTML(u'foo').

Fixes #12724

Modify Ticket

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