[X2Go-Commits] [maintenancescripts] 02/02: git/hooks/update-script._irkerhook.py_: employ weird workaround to make irkerhook correctly apply data to the templäte in case of Unicode characters in the log message, author name or email address.
git-admin at x2go.org
git-admin at x2go.org
Tue Oct 10 06:10:01 CEST 2017
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository maintenancescripts.
commit 149dea673fd34f033a3fbdc91f92d77f17dc21f6
Author: X2Go Administratör <git-admin at x2go.org>
Date: Tue Oct 10 06:09:45 2017 +0200
git/hooks/update-script._irkerhook.py_: employ weird workaround to make irkerhook correctly apply data to the templäte in case of Unicode characters in the log message, author name or email address.
---
git/hooks/update-script._irkerhook.py_ | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/git/hooks/update-script._irkerhook.py_ b/git/hooks/update-script._irkerhook.py_
index 672fc95..576cadb 100755
--- a/git/hooks/update-script._irkerhook.py_
+++ b/git/hooks/update-script._irkerhook.py_
@@ -104,6 +104,14 @@ class Commit:
except IOError as e:
self.url = ""
print "IOError: {0}:{1}".format(e.errno, e.strerror)
+ # Fixes a weird error if the log message, author name or email contain
+ # unicode characters. This shouldn't happen, since all variables (but
+ # self.url) are normal byte strings, correctly encoded.
+ # For some reason, applying the dict to the template still fails.
+ # It doesn't fail if logmsg et. al. are converted to unicode objects first.
+ self.logmsg = unicode(self.logmsg, 'utf-8')
+ self.author_name = unicode(self.author_name, 'utf-8')
+ self.mail = unicode(self.mail, 'utf-8')
res = self.template % self.__dict__
return unicode(res, 'UTF-8') if not isinstance(res, unicode) else res
--
Alioth's /srv/git/code.x2go.org/maintenancescripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/maintenancescripts.git
More information about the x2go-commits
mailing list