Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

#4933 closed defect (worksforme)

UnicodeDecodeError: 'ascii' codec can't decode byte

Reported by: Kim Tuan Owned by: Christian Boos
Priority: normal Milestone:
Component: version control Version: 0.10.3.1
Severity: normal Keywords: mercurial unicode
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

This error comes up when seeing Timeline or browsing source and the resulting trace is

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 387, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.4/site-packages/trac/versioncontrol/web_ui/browser.py", line 143, in process_request
    self._render_directory(req, repos, node, rev)
  File "/usr/lib/python2.4/site-packages/trac/versioncontrol/web_ui/browser.py", line 168, in _render_directory
    changes = get_changes(self.env, repos, [i['rev'] for i in info])
  File "/usr/lib/python2.4/site-packages/trac/versioncontrol/web_ui/util.py", line 47, in get_changes
    shorten=True, absurls=absurls)
  File "/usr/lib/python2.4/site-packages/trac/wiki/formatter.py", line 1007, in wiki_to_oneliner
    return Markup(out.getvalue())
  File "/usr/lib/python2.4/site-packages/trac/util/html.py", line 46, in __new__
    return unicode.__new__(self, text)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 20: ordinal not in range(128)

The problem comes from some changesets comment which include characters with accent.

I'm using Trac 0.10.3 with MercurialPlugin.

Attachments (0)

Change History (6)

comment:1 by Christian Boos, 18 years ago

Component: generalversion control
Keywords: mercurial unicode added
Owner: changed from Jonas Borgström to Christian Boos

Which revision of the mercurial plugin?

It seems to me that the latest ones are doing the proper unicode conversion of the changeset message…

comment:2 by anonymous, 18 years ago

I'm using the 0.10.0.2 version updated from the Sandbox/mercurial-plugin repository.

comment:3 by Christian Boos, 18 years ago

Milestone: none
Version: 0.10.3.1

That's most surprising. The changeset.message can only be an unicode object, by looking at the corresponding source for the plugin.

Please insert the following line:

    print 'Retrieving message for changeset:', self.rev, `self.message`

after line source:sandbox/mercurial-plugin/tracvc/hg/backend.py@4468#L473 (and verify that you actually have the to_unicode(desc) conversion in your backend.py file).

comment:4 by Kim Tuan, 18 years ago

Resolution: fixed
Status: newclosed

I've solved the error. After reinstallation of both trac and plugin, it works well and unicode is supported.

comment:5 by Christian Boos, 18 years ago

Resolution: fixed
Status: closedreopened

Great! But we use worksforme resolution in this case…

comment:6 by Christian Boos, 18 years ago

Milestone: none
Resolution: worksforme
Status: reopenedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.