Opened 17 years ago

Last modified 11 years ago

#2012 closed defect

The module does not work with unicode data in the repository. — at Version 4

Reported by: anonymous Owned by: Samat Jain
Priority: normal Component: TracGitPlugin
Severity: major Keywords: UTF-8 unicode
Cc: Trac Release: 0.10

Description (last modified by Ryan J Ollos)

I installed the plugin but it gave the following error when I tried to run it :

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 406, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.5/site-packages/trac/versioncontrol/web_ui/browser.py", line 143, in process_request
    self._render_directory(req, repos, node, rev)
  File "/usr/lib/python2.5/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.5/site-packages/trac/versioncontrol/web_ui/util.py", line 47, in get_changes
    shorten=True, absurls=absurls)
  File "/usr/lib/python2.5/site-packages/trac/wiki/formatter.py", line 1009, in wiki_to_oneliner
    return Markup(out.getvalue())
  File "/usr/lib/python2.5/site-packages/trac/util/html.py", line 46, in __new__
    return unicode.__new__(self, text)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 7: ordinal not in range(128)

I don't know much python, but my investigation into issue made me believe that this is a problem when trac is attempting to encode a utf-8, witch trac believes is ascii, into utf-8.

Change History (6)

Changed 17 years ago by Victor Bogado da Silva Lins

Attachment: git_plugin.diff added

Diff for a fix to this problem

comment:1 Changed 17 years ago by Victor Bogado da Silva Lins

The patch I submitted earlier broke the viewing of files, I did a more deep research and found a way that it works for me. There may be other places to put a to_unicode call, that are not causing problems with mine repository (path names?)

The better solution would be to inform the output, witch is a pipe as far as I can see, to return unicoded strings from it's read method. I don't know hot to do this.

Changed 17 years ago by Victor Bogado da Silva Lins

Attachment: git_plugin.2.diff added

Patch that do not break the view file operation.

comment:2 Changed 17 years ago by Victor Bogado da Silva Lins

ops. The patch has the fix for the other issue (ticket #2013). Just ignore the second group of changes.

comment:3 Changed 13 years ago by anonymous

Keywords: UTF-8 added; utf-8 removed

comment:4 Changed 11 years ago by Ryan J Ollos

Description: modified (diff)
Note: See TracTickets for help on using tickets.