[Python-apps-team] Bug#705549: trac-git: Loading the timeline causes a Genshi UnicodeDecodeError without trace.
Richard Genoud
richard.genoud at gmail.com
Tue Apr 16 15:02:14 UTC 2013
Package: trac-git
Version: 0.12.0.5+722342e-1
Severity: important
Tags: patch
Dear Maintainer,
I experienced this bug: http://trac.edgewall.org/ticket/10980 with trac-git plugin 0.12.
Description:
Genshi UnicodeDecodeError when showing files whith trac-git repositories browser.
NB: These files have some characters with accents.
The trac-git plugin branch 0.12 is no longer maintained as trac-git is now part of trac-1.0.
So I backport the patch to the 0.12 version: (Tested on debian wheezy, it works perfectly)
>From 741328a588e6d799747958499ccc06c1056ae83f Mon Sep 17 00:00:00 2001
From: Richard Genoud <richard.genoud at gmail.com>
Date: Wed, 10 Apr 2013 14:26:57 +0200
Subject: [PATCH] backport bug fix: Loading the timeline causes a Genshi
UnicodeDecodeError without trace.
http://trac.edgewall.org/ticket/10980
---
tracext/git/PyGIT.py | 11 +++++++----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/tracext/git/PyGIT.py b/tracext/git/PyGIT.py
index 8e8f7d3..b03b4cc 100644
--- a/tracext/git/PyGIT.py
+++ b/tracext/git/PyGIT.py
@@ -423,7 +423,8 @@ class Storage(object):
def get_branches(self):
"returns list of (local) branches, with active (= HEAD) one being the first item"
- return self.rev_cache.branch_dict
+ return ((self._fs_to_unicode(name), sha)
+ for name, sha in self.rev_cache.branch_dict)
def get_commits(self):
return self.rev_cache.rev_dict
@@ -449,7 +450,8 @@ class Storage(object):
return []
if resolve:
- return [ (k, v) for k, v in _rev_cache.branch_dict if v in rheads ]
+ return ((self._fs_to_unicode(k), v)
+ for k, v in _rev_cache.branch_dict if v in rheads)
return rheads
@@ -507,7 +509,7 @@ class Storage(object):
def verifyrev(self, rev):
"verify/lookup given revision object and return a sha id or None if lookup failed"
- rev = str(rev)
+ rev = self._fs_from_unicode(rev)
_rev_cache = self.rev_cache
@@ -590,7 +592,8 @@ class Storage(object):
return None
def get_tags(self):
- return [ e.strip() for e in self.repo.tag("-l").splitlines() ]
+ return (self._fs_to_unicode(e.strip())
+ for e in self.repo.tag('-l').splitlines())
def ls_tree(self, rev, path=""):
rev = rev and str(rev) or 'HEAD' # paranoia
--
1.7.10.4
Best regards,
Richard.
-- System Information:
Debian Release: 7.0
APT prefers testing-updates
APT policy: (500, 'testing-updates'), (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages trac-git depends on:
ii git [git-core] 1:1.7.10.4-1+wheezy1
ii python 2.7.3-4
ii python2.6 2.6.8-1.1
ii python2.7 2.7.3-6
ii trac 0.12.3-1
trac-git recommends no packages.
trac-git suggests no packages.
-- no debconf information
More information about the Python-apps-team
mailing list