#303 closed defect (fixed)
http://trac.osgeo.org/proj/timeline <- Internal Error with UnicodeDecodeError
Reported by: | neteler | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | SysAdmin | Keywords: | trac unicode |
Cc: | hobu |
Description
http://trac.osgeo.org/proj/timeline reports only this Internal Error:
Repository checkins event provider (ChangesetModule) failed: UnicodeDecodeError: 'utf8' codec can't decode bytes in position 41-43: invalid data
likely due to CVS -> SVN migration of PROJ4.
Here is some material: http://trac.edgewall.org/wiki/UnicodeDecodeError which may be helpful.
Markus
Change History (4)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
Cc: | added |
---|---|
Owner: | changed from | to
follow-up: 4 comment:3 by , 16 years ago
Keywords: | unicode added |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Circa line 69 of /usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py I have changed this:
def _convert_row(self, row): return tuple([(isinstance(v, str) and [v.decode('utf-8')] or [v])[0] for v in row])
to:
def _convert_row(self, row): result = [] for v in row: if isinstance(v,str): try: item = v.decode('utf-8') except: item = '(undecodable utf-8 string)' else: item = v result.append(item) return tuple(result) #return tuple([(isinstance(v, str) and [v.decode('utf-8')] or [v])[0] # for v in row])
This seems to successfully replace untranslatable unicode messages with "(undecodable utf-8 string)". It turns out one of the commit messages include special characters.
If we upgrade Trac we may need to re-apply a variation of this patch.
I did review cvs2svn and it was not immediately obvious how to rerun the translation in such a way that the corrupt string would not be in the log messages.
comment:4 by , 16 years ago
Replying to warmerdam: ...
This seems to successfully replace untranslatable unicode messages with "(undecodable utf-8 string)". It turns out one of the commit messages include special characters.
If we upgrade Trac we may need to re-apply a variation of this patch.
I did review cvs2svn and it was not immediately obvious how to rerun the translation in such a way that the corrupt string would not be in the log messages.
Here is the GRASS conversion script which does some encoding magic: http://josef.fsv.cvut.cz/~landa/grass-cvs2svn/grass-cvs2svn-base.sh
Maybe helpful...
I'm yet not up to having a clue here ....
According to the mentioned page at "edgewall" I understand that either a different character conversion should have been applied while converting from CVS to SVN or a more recent release of Trac might solve the problem.
Anyone's experienced about configuring Trac !?
Cheers, Martin.